From owner-freebsd-questions Tue Sep 5 14:31:26 2000 Delivered-To: freebsd-questions@freebsd.org Received: from cactus.fi.uba.ar (cactus.fi.uba.ar [157.92.49.108]) by hub.freebsd.org (Postfix) with ESMTP id A106837B42C for ; Tue, 5 Sep 2000 14:31:05 -0700 (PDT) Received: from cactus.fi.uba.ar (cactus.fi.uba.ar [157.92.49.108]) by cactus.fi.uba.ar (8.9.3/8.9.3) with ESMTP id SAA22167; Tue, 5 Sep 2000 18:27:51 -0300 (ART) (envelope-from fgleiser@cactus.fi.uba.ar) Date: Tue, 5 Sep 2000 18:27:51 -0300 (ART) From: Fernando Gleiser To: David.Johnston@vviuh221.vvi.com Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Thanks for the good book and newbie question ... In-Reply-To: <10009051616.AA02890@vviuh221.vvi.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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