Date: Sat, 31 Oct 1998 00:29:48 -0600 From: Dan Nelson <dnelson@emsphone.com> To: Alfred Perlstein <bright@hotjobs.com>, Satish Basvapatri <satishb@hotmail.com> Cc: freebsd-hackers@freefall.cdrom.com Subject: Re: Hi Message-ID: <19981031002948.A23594@emsphone.com> In-Reply-To: <Pine.BSF.4.05.9810310018100.9417-100000@porkfriedrice.ny.genx.net>; from "Alfred Perlstein" on Sat Oct 31 00:24:35 GMT 1998 References: <19981031051258.24809.qmail@hotmail.com> <Pine.BSF.4.05.9810310018100.9417-100000@porkfriedrice.ny.genx.net>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Oct 31), Alfred Perlstein said: > On Sat, 31 Oct 1998, Satish Basvapatri wrote: > > I have one server and many clients. Server listens at a particular > > port. The clients themselves acts as servers for other clients and > > the opeen the connection and never closes them. If the server > > crashes without closing the socket when I am trying to restart the > > server I am getting error message "port in user". Can you suggest > > is there any way to clear up this port? > > a) don't write buggy code :) > b) setup a signal handler,(i assume for SIGSEGV) keep track of all > sockets and close them in the handler > c) the client+servers could then catch the SIGPIPE on writes to > themain server as an indication to try to reconnect in "X" amount of > time, if the slave servers are performing reads, you should set them > up to timeout after some time if no data comes across and take it as > a signal to reconnect. And the correct answer is of course d) enable the socket option SO_REUSEADDR. See the Sockets FAQ at http://kipper.york.ac.uk/~vic/sock-faq, sections 4.1 and 4.5. -Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19981031002948.A23594>