"Frank A. Uepping" <(E-Mail Removed)> writes:
> a UDP socket may be connect()ed. That is, the UDP socket only accepts/sends
> datagrams from/to the connected destination.
> Is it possible to un-connect a UDP socket (that is, revert the socket back
> to the unconnected state)?
I haven't tried this on Linux, but here's an excerpt from the socket
programming bible, _UNIX Network Programming_, Volume 1, by W.
Richard Stevens, p. 226:
To unconnect a UDP socket we call connect but set the family member
of the socket address structure (sin_family for IPv4 or sin6_family
for IPv6) to AF_UNSPEC. This might return an error of EAFNOSUPPORT
(p. 736 of TCPv2) but that is OK. It is the process of calling
connect on an already connected UDP socket that causes the socket
to become unconnected (pp. 787-788 of TCPv2).
"TCPv2" refers to _TCP/IP Illustrated_, Volume 2, which is a detailed
description of the BSD implementation.
Try it and let us know if it works the way you expect.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/