From owner-freebsd-questions Wed Apr 17 15:12:13 2002 Delivered-To: freebsd-questions@freebsd.org Received: from excelsystems.com (h24-70-196-170.sbm.shawcable.net [24.70.196.170]) by hub.freebsd.org (Postfix) with ESMTP id 636F637B404 for ; Wed, 17 Apr 2002 15:12:08 -0700 (PDT) Received: from home [24.70.196.175] by excelsystems.com [127.0.0.1] with SMTP (MDaemon.PRO.v5.0.1.R) for ; Wed, 17 Apr 2002 15:07:08 -0700 Message-Id: <4.2.0.58.20020417144927.00c00e20@192.168.0.64> X-Sender: hunter#pop.islandnet.com@192.168.0.64 X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 Date: Wed, 17 Apr 2002 15:00:27 -0700 To: Edwin Groothuis From: Marc Hunter Subject: Re: Killing a FIN_WAIT_2 Cc: freebsd-questions@freebsd.org In-Reply-To: <20020418073640.N56548@k7.mavetju.org> References: <4.2.0.58.20020417121658.00954290@192.168.0.64> <4.2.0.58.20020417121658.00954290@192.168.0.64> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-MDRemoteIP: 24.70.196.175 X-Return-Path: hunter@hunter.net X-MDaemon-Deliver-To: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 07:36 AM 04/18/02 +1000, Edwin Groothuis wrote: >On Wed, Apr 17, 2002 at 12:18:35PM -0700, Marc Hunter wrote: > > I have a tcp connection that's sitting in FIN_WAIT_2 according to netstat > > -a, and it's locking up the port, preventing me from restarting my server > > app... I know those connections time out after some time, but is there > any > > way of explicitly killing it? (other than rebooting) > >There is no such thing. You should be able to restart the server >anyway if you set the SO_REUSEADDR on the socket: > > setsockopt(fd4,SOL_SOCKET,SO_REUSEADDR,(char *)&x,sizeof(x)) Thanks for the info, although it does not seem to to the trick... Perhaps you meant SO_REUSEPORT? If so, I'm not sure that will work for me in this case, as I do actually want it to fail if another instance of the server is running. I'm making the assumption that the sockets returned from accept inherit the options specified on the accepting socket...? (I ran setsockopt on the accepted socket as well, just to be sure...) Rgds, Marc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message