> UDP sockets can be ``connected'' to peers using the connect() call. UDP
is
> connectionless; the meaning of connect() is simply to record, within the
local
> kernel, a destination for the socket so that you can use send() instead
of
> sendto(). It's a convenience that is primarily useful for clients.

Actually it is more than a convenience if you only intend to communicate to
one
peer address; it improves performance because the kernel will not have to
"connect/unconnect" the socket everytime it needs to send a datagram.
Granted
the performance is nil for most UDP applications which don't use large
bandwidth but for those that do (and TCP still doesn't make sense for some
reason) then it is the preferred way.

Connecting a server UDP socket also insures that the only packets passed to
your
socket are from the address you expect which is cool if ya ask me.

     Melvin Smith
     [EMAIL PROTECTED]


-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to