home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / wizards / 5252 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  2.4 KB

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