home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.wizards:5252 comp.unix.programmer:5714 comp.unix.internals:2060 comp.unix.questions:14735
- Path: sparky!uunet!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!ira.uka.de!smurf.sub.org!news
- From: urlichs@smurf.sub.org (Matthias Urlichs)
- Newsgroups: comp.unix.wizards,comp.unix.programmer,comp.unix.internals,comp.unix.questions
- Subject: Re: HELP !!!!! TCP/IP, SOCKETS
- Followup-To: comp.unix.questions
- Date: 16 Dec 1992 16:53:22 +0100
- Organization: University of Karlsruhe, FRG
- Lines: 42
- Message-ID: <1gnjdiINNs3h@smurf.smurf.sub.org>
- References: <1992Dec11.162251.1887@us-es.sel.de>
- NNTP-Posting-Host: 127.0.0.1
-
- [ Please do not crosspost to comp.unix.wizards,comp.unix.internals, and
- comp.unix.questions. Followups are redirected to the latter only. ]
-
- In comp.unix.wizards, article <1992Dec11.162251.1887@us-es.sel.de>,
- lal@us-es.sel.de (US/EM Deepak Lal - Systemverwaltung #5657) writes:
- >
- > I have a big problem. I will be thankfull for ANY reply whatsoever. It is
- > urgent:
- >
- Every problem usually is. :-/
-
- > When the parentprocess is killed, the child processes realize the
- > broken connection. On typing netstat no established
- > connections are visible.
- > After the parent server process is restarted, the
- > child processes connect AGAIN to the same port and the communication
- > takes place as before. BUT SOMETIMES and UNFORTUNATELY NOT reproducable
- > scene is that :
- > After the parent Server dies, all TCP connections are still alive
- > ( visible with netstat). And NOW if the parent server process is restarted
- > he can't bind to the previous port and hence no communication
- > is possible *sob*
- >
- Does the server fork? If so, why don't you close all its file descriptors
- in the child and/or set their close-on-exec flag?
-
- > 2) Is it possible to remove the pending TCP/IP connections after
- > the parent server dies and TCP/IP connections are still lingering. What can
- > the server parent process do to remove the lingering TCP connections on
- > restart.
- >
- Please define _lingering_.
-
- If the socket you used to accept() things with is still open in any program,
- forget it. (Well, OK, kill the offender and try again.)
-
- If there are just some connections left open, set the SO_REUSEADDR flag
- on the socket before listening with it.
-
- --
- Matthias Urlichs -- urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de /(o\
- Humboldtstrasse 7 -- 7500 Karlsruhe 1 -- Germany -- +49-721-9612521 \o)/
-