I am working on a small network game prototype that will play on local networks using UDP. To detect other computers on the network, I am investigating broadcasting. However, I am still not sure of some details regarding the configuration / use of the UDP socket (new to the network). I found a good library to use after starting the game, but first all the computers on which the game is running should be detected, and one should be selected as the server. Therefore, I ask the following questions:
- Is it possible to use one UDP socket to listen and send broadcasts? I am sure that the answer to this question is yes, but I wanted to check it.
- When using UDP do you really need to use
bind() ? As far as I understand, connect() not required, as well as send()/recv() , since they are TCP sendto()/recvfrom() ).
Gemini14
source share