From owner-freebsd-hackers Tue Sep 21 17:27:20 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 2463314F4D for ; Tue, 21 Sep 1999 17:27:18 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id RAA09627; Tue, 21 Sep 1999 17:27:16 -0700 (PDT) (envelope-from dillon) Date: Tue, 21 Sep 1999 17:27:16 -0700 (PDT) From: Matthew Dillon Message-Id: <199909220027.RAA09627@apollo.backplane.com> To: Brian Dean Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: how to shut down a TCP connection References: <199909212245.SAA02737@vger.foo.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :Hi, : :I'm doing TCP development on a custom operating system that I've :written and am using my FreeBSD box for testing my TCP stack. I'm in :the early stages right now and I have a lot of bugs. One of my bugs :is that I shut down a connection on my end but I'm doing something :wrong and the connection on the FreeBSD side stays up, i.e.: : :[bsd@vger]:/net- netstat :Active Internet connections :Proto Recv-Q Send-Q Local Address Foreign Address (state) :tcp 0 0 vger.telnet bos.5000 ESTABLISHED : :'vger' is my FreeBSD machine and 'bos' is my experimental OS. The :connecton on 'bos' at this point is actually closed. : :Does anyone know how I can manually shutdown the above connection on :'vger' short of waiting a really long time or rebooting? : :Thanks, :-Brian :-- :Brian Dean brdean@mindspring.com Turn on keepalives and set the parameters really low so the connection times out after a couple of minutes. Experiment. Remember that the below will effect all your TCP connections, so don't make the timeout too low. sysctl -w net.inet.tcp.always_keepalive=1 sysctl -w net.inet.tcp.keepintvl=60 sysctl -w net.inet.tcp.keepinit=60 sysctl -w net.inet.tcp.keepidle=300 If the FreeBSD side is still in the ESTABLISHED state, it is not getting a FIN or not getting a proper FIN. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message