Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Sep 2000 18:27:51 -0300 (ART)
From:      Fernando Gleiser <fgleiser@cactus.fi.uba.ar>
To:        David.Johnston@vviuh221.vvi.com
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Thanks for the good book and newbie question ...
Message-ID:  <Pine.BSF.4.21.0009051822150.21413-100000@cactus.fi.uba.ar>
In-Reply-To: <10009051616.AA02890@vviuh221.vvi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 5 Sep 2000, David Johnston wrote:

> Hi Again FreeBSD:
> 
> > UNIX Network Programming, Volume 1, second Edition.
> 
> I wrote my first client/server sub-system using the book's examples. It is so cool!
> 
> Now I need to ask the occasional question. Is there a better freebsd mail  
> list for these type of questions? The one I have now is the following:
> 
> When I kill the server then immediately restart it then bind gives "bind  
> error: Address already in use". But if I wait for about 1 minute then I can  
> start the server up again. How do I make it such that bind will "figure it  
> out" right away, or (put another way) why can't bind figure out that the  
> address and port are no longer in use?

The answer is on the same book, in the chapter 7 (socket options).
You need to enable the SO_REUSEADDR option in the socket. 
see also setsockopt(2).

> 
> Sincerely,
> 
> David Johnston
> djohn@vvi.com
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0009051822150.21413-100000>