![](smile.gif)
udp socket binding
Hi. I'm trying to create a UDP Proxy program but I'm having troubles understanding some things about UDP. Here's the situation. There is a game server that sends out client updates to all it's clients on a constant port of 4949. I have no access to the server, and am not able to alter anything with it. The client creates the UDP socket for the updates and binds the socket to it's local address on port 0 (allowing a free port to be chosen) and recieves the updates from the server. I also have no access to the client code, and am not able to alter anything with it. What I'm trying todo is create a simple proxy server the client and server will send packets through so the proxy can record data coming from the server in an attempt to make a program to playback the recorded game later. Right now for the proxy I have one socket setup for UDP that binds to it's local address on port 4949 and recieves the packets from the server and attempts to send them to the client (which is on the same computer/address). This is where the problem comes in. I don't know which port the client has binded to because the application picks it and it's new every time it starts, so I can't "forward" the packet to the client from the proxy because I don't know the client's port. I don't understand how the game server knows this port either. I know this is definently possible, I just don't have alot of experience with datagram sockets. If anyone that understands what I'm trying todo please shed some light on the answer!
-Brad
[edited by - bmm on August 23, 2003 4:15:28 AM]
![](smile.gif)
After many more hours of testing a debugging I found out that when I''m forwarding the UDP update packet from the game server to the client on the local machine, that the packet is actually getting recved from my proxy server app instead of the game client. How do I fix this?? Is it even possible to send a UDP packet to the local address in the manner I''m trying todo it in? I plan on creating a "dumb" game server clone for game client to connect to and send the recorded game packets (saved from a previous time from the server) to the game client and have the game client just render it. I know there are a few other games that have "recorders" like this and even one for the game I''m trying to make one (although it''s lacking in full functionality), so I know it''s definently possible somehow. Anyone?
For a starters, USE WHITESPACE
---Yesterday is history, tomorrow is a mystery, today is a gift and that's why it's called the present.
And give us some code.
You didn't forget to set the addresslength to 8 before receicing a packet?
[edited by - Siaon on August 23, 2003 11:13:31 AM]
[edited by - Siaon on August 23, 2003 11:14:00 AM]
You didn't forget to set the addresslength to 8 before receicing a packet?
[edited by - Siaon on August 23, 2003 11:13:31 AM]
[edited by - Siaon on August 23, 2003 11:14:00 AM]
---Yesterday is history, tomorrow is a mystery, today is a gift and that's why it's called the present.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement