I\'m writing a point-to-point message queue system, and it has to be able to operate over UDP. I could arbitrarily pick one side or the other to be the \"server\" but it do
UDP is connectionless, so there's little sense for the OS in actually making some sort of connection.
In BSD sockets one can do a connect on a UDP socket, but this basically just sets the default destination address for send (instead giving explicitly to send_to).
Bind on a UDP socket tells the OS for which incoming address to actually accept packets (all packets to other addresses are dropped), regardless the kind of socket.
Upon receiving you must use recvfrom to identify which source the packet comes from. Note that if you want some sort of authentication, then using just the addresses involved is as insecure as no lock at all. TCP connections can be hijacked and naked UDP literally has IP spoofing written all over its head. You must add some sort of HMAC