Page 1 of 1

A UDP question

Posted: Thu Aug 30, 2012 7:10 pm
by RichAlgeni
For two way UDP communication, do you need to open a network server on each end?

For instance, two programs wish to talk to each other using the non-critical protocol UDP. UDP is connection-less, so there no error indication if a server exists or not to receive the data sent, so does each of the programs need to spawn a network server, and monitor the corresponding server events to handle two way communication?

Just trying to round-out my network skills.

Re: A UDP question

Posted: Mon Sep 03, 2012 2:29 pm
by auser
You don't need a network-server on each end. Regarding the error-indication: You have to create your own handshake/protocol. Means send data from the client to the server and check for events via NetworkClientEvent and NetworkServerEvent. If you use UDP skip waiting for #PB_NetworkEvent_Connect or #PB_NetworkEvent_Disconnect.

Re: A UDP question

Posted: Mon Sep 03, 2012 3:13 pm
by RichAlgeni
Thanks 'a', I did that in my sample program I posted, but I was unable to get communication back to the client side, so I wasn't sure.