A UDP question

Everything else that doesn't fall into one of the other PB categories.
User avatar
RichAlgeni
Addict
Addict
Posts: 935
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

A UDP question

Post 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.
auser
Enthusiast
Enthusiast
Posts: 195
Joined: Wed Sep 06, 2006 6:59 am

Re: A UDP question

Post 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.
User avatar
RichAlgeni
Addict
Addict
Posts: 935
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: A UDP question

Post 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.
Post Reply