Kurt Roeckx <Q(at)ping(dot)be> writes:
> Then it connects to itself. I don't get the logic behind that
> howver.
At least on HPUX, the connect(2) man page saith
If the socket is of type SOCK_DGRAM, connect() specifies the peer
address to which messages are to be sent, and the call returns
immediately. Furthermore, this socket can only receive messages sent
from this address.
The "furthermore" is what we are after.
regards, tom lane