reuse of addresses when calling bind()

Mark Boolootian booloo at lll-crg.llnl.gov
Fri Nov 30 11:01:51 AEST 1990


I've got a meeting in a couple minutes so I'm going to try and ask this quickly.
If you setsockopt() with SO_REUSEADDR, as I understand it, you should be able
to issue a bind() for a ip/port address that is already in use.  However, it
appears that it is still possible for bind() to return the error EADDRINUSE (for
example, look at routine getdatasock() in ftpd.c where they have a loop that
retries the bind() several times before giving up, all the while checking for
EADDRINUSE).  

What I'd like to know is why this happens, in lieu of the call to setsockopt().
Thanks in advance.  Email would be nice but I'll wade through stuff if need be.

regards,
mb

booloo at lll-crg.llnl.gov



More information about the Comp.unix.wizards mailing list