Click to See Complete Forum and Search --> : Using x receive and send sockets + IOCP


DV6
February 12th, 2008, 12:57 PM
Hi all,

Im currently working on a new version of my client application who´s sole purpose is to query massive ammounts of servers for there status. All data for this subject will be transfered over UDP.

Basicly it goes like this: I send the request and The server responses with 1 or more packets.

Now before i start designed the application i was hoping anyone of you could tell me if it is possible to use a specific ammount of sockets who listen for incoming data from any random source?

I know this is possible when creating a server application since then your can listen to a given port and the client always have to send there requests to that port. however when creating a client, my send sockets send the data through their own port and the servers send their responses back to that port. Is it possible to modify the send in that way that the senders port will be the one used by a receiver socket?

Thanks in advance!

Koen

Lindley
February 12th, 2008, 01:15 PM
Do you have control of the server code? If so, you can always piggyback a port number on the query of the port you'd like the response to use.

If not, then---assuming I'm understanding the question---it should certainly be possible to specify the client port used, rather than letting it be assigned randomly as usually happens.

MikeAThon
February 12th, 2008, 04:45 PM
.... Is it possible to modify the send in that way that the senders port will be the one used by a receiver socket?
What benefit do you hope to obtain by doing so?

Mike

Edders
February 13th, 2008, 07:54 AM
When you receive a UDP datagram you can check from which IP address and port number it came and use that information to send the answer back to where the initial datagram came from.

Is that what you are looking for?