More questions on sockets

Sean Casey sean at ms.uky.edu
Wed Jun 19 05:26:52 AEST 1991


In article <1991Jun14.162215.14657 at ncsu.edu>, jwb at cepmax.ncsu.edu (John W. Baugh Jr.) writes:
>   - when trying to bind a stream socket I sometimes get an error
>     "Address already in use", even though I've closed the socket (for
>     example, when I run the program in succession a couple of times).
>     Is there something else I have to do?

This should be in a frequently asked questions list :).

Check out the SO_REUSEADDR option for setsockopt(). Hint: use it after
socket() and before bind().

Sean
-- 
** Sean Casey  <sean at s.ms.uky.edu>



More information about the Comp.unix.programmer mailing list