Sending AF_INET UDP DataGrams to multiple destinations

Mark Lawrence mark at DRD.Com
Sat Oct 20 02:48:40 AEST 1990


I've written a function which sends an opaque data packet via
AF_INET/UDP using the sendto() function to potentially different
destinations, i.e., port number will vary from invocation to
invocation.

Currently, I check on every invocation to see if the port number to send
to is different and if so, close the socket and re-open (using the
socket() function).  Is this really necessary?  I set it up like this
because I was afraid that the lowerlevel code would get confused if I
used the same socket descriptor but different port numbers in the sendto()
call.
-- 
mark at DRD.Com uunet!apctrc!drd!mark$B!J%^!<%/!!!&%m!<%l%s%9!K(B



More information about the Comp.unix.programmer mailing list