From owner-freebsd-questions Wed Sep 27 1:37:11 2000 Delivered-To: freebsd-questions@freebsd.org Received: from merganser.its.uu.se (merganser.its.uu.se [130.238.6.236]) by hub.freebsd.org (Postfix) with ESMTP id 3423937B423 for ; Wed, 27 Sep 2000 01:37:06 -0700 (PDT) Received: from regulus.student.UU.SE ([130.238.5.2]:55689 "HELO ertr1013.student.uu.se") by merganser.its.uu.se with SMTP id ; Wed, 27 Sep 2000 10:36:50 +0200 Received: (qmail 1076 invoked by uid 1001); 27 Sep 2000 08:36:58 -0000 Date: Wed, 27 Sep 2000 10:36:58 +0200 From: Erik Trulsson To: Bjorn Tornqvist Cc: freebsd-questions@freebsd.org Subject: Re: bind(2) gives EADDRINUSE during 60 seconds. Why? Message-ID: <20000927103658.A1056@student.uu.se> Mail-Followup-To: Bjorn Tornqvist , freebsd-questions@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from bjorn@tornqvist.net on Wed, Sep 27, 2000 at 09:58:13AM +0200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Sep 27, 2000 at 09:58:13AM +0200, Bjorn Tornqvist wrote: > > Howdy! > > I hope someone can explain this behaviour to me; The kernel seems to > make a stream port "un-rebindable" within 60 seconds after another > stream-server-process has had the port bound. > The easiest way to illustrate (with port/sysutils/socket): > Terminal one: Terminal two: > socket -s 19191 > telnet localhost 19191 > ^C > Connection closed by foreign host > socket -s 19191 > socket: server socket: Address already in use > > [wait 60 seconds] > ...and socket -s 19191 will succeed again. > > What is causing this? This behaviour causes my application to fail a > critical requirement and there must surely be something wrong with my > (aswell as socket(1)'s) interaction with the tcp/ip stack? > This is actually correct behaviour for tcp/ip. It has to do with the tcp/ip stack having to timeout when a connection is closed in case some packet got lost/delayed when closing the connection. For details read some good book about TCP/IP. (Or the relevant RFCs) -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message