Results 1 to 2 of 2

Thread: C# Sockets - With Events?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    121

    C# Sockets - With Events?

    Hey guys,

    I have quite alot of problems but I think to get as much help I can I'll start from well, the start! Ok basically, I have an online game that connects to a IP Address. Firstly the game gets the IP addresses from 'maps.php' and then connects to the server. Basically what I have at the moment is a proxy that intercepts the 'maps.php' file and edit all the IPs to 127.0.0.1. What I now need is a easy way to kinda make a client and server in one. What I need is something that listens to connections on port 8080. It then needs to get ALL packets and then forward them onto the real IP address they were meant for. So Basically it looks like this:

    Game -------
    maps.php ----> Proxy - 136.818.23.198 -> 127.0.0.1 ---> maps.php

    Game -------> My Program (127.0.0.1) ------> Original Destination (136.818.23.198)

    What I have at the moment is a few sockets that listen and then connect but what I don't have is a easy way of detecting when a packet arrives on either side. As this is a game it needs to be able to handle upwards of 10-50 packets a second (or more). If there is an efficient way of forwarding packets with NO packet loss I would love to hear it If not could someone please help me with writing a while(true) loop that receives packets from both ends and then sends them onward. Obviously because this is a game, most of the time the real server will be responding to packets. I would really love to have events because I need to edit packets as they come in.

    Thanks for any help

    -Josh

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    121

    Re: C# Sockets - With Events?

    Bump

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width