Archived

This topic is now archived and is closed to further replies.

henryx

UDP transfer

Recommended Posts

Hi, I have a simple client-server TCP/IP server working ok and I now want to change it over to the UDP protocol rather than TCP but I am having a few problems - possibly because I''m not 100% sure about what is required when establishing a UDP connection. Can anybody tell me if this is the correct method. 1. Start up winsock on both applications 2. Create sockets of type SOCK_DGRAM on each application 3. Bind sockets on both applications 4. Use sendto and recvvfrom to send and recieve data. Am I missing anything. I think I am correct in that there is no need to listen() and connect() with a UDP connection. Is it correct to send and recieve over the one socket that has been created on each application. This is just a win32 console application at this stage. I can post some code if needed but your help on these concepts would be appreciated so I can see if I''m on the correct track. Thanks henry

Share this post


Link to post
Share on other sites
That''s it.

If you want to check your code against something that works.
You can find a UDP client / server here.

http://www.ecst.csuchico.edu/~beej/guide/net/html/

At this time the page appears to be down for some reason.. Check back soon.

Share this post


Link to post
Share on other sites