I dislike using the term "connections" here, that term has no place in discussions about UDP since UDP is a connectionLESS protocol.
To do what you want, all you need to do is open a different port on the client.
It is UDP, but it still has different source and destination ports. If you send a packet to the server with a destination port of 5000 and a source port of 6000, the server will send all replies with exactly the opposite information; packets will have a source port of 5000 and a destination port of 6000 going from the server to the client.
Your problem is you're opening UDP port 5000 on the client, and sending your data to UDP port 5000 on the server. There is no need to do this. Use any port you want on the client, just make sure the destination port is 5000.
Main Topics
Browse All Topics





by: yakov_bPosted on 2002-12-02 at 08:43:41ID: 7520830
either the client listens and the server connects to it or the other way.
R,...)
the way to do this is the same as u did the first socket.
u may pre-define the ports as u wish or use a random port and let the other side know using the first socket.
if u wanna use a predifined server port and let the server initiate the connection to the client (like passive ftp) u'll have to bind the server socket after setsockopt(...,SO_REUSEADD