Article View: comp.unix.programmer
Article #139is there an unbind() command for sockets
From: DAVID W THOMAS
Date: Mon, 27 Jul 1992 18:09
Date: Mon, 27 Jul 1992 18:09
29 lines
1729 bytes
1729 bytes
Once a process is listening to a socket, is there anyway to shutdown the socket and allow a new process to listen to the socket? (without killing the process and all of it's children)? In more detail: I would like to be able to perform software upgrades to a batch server. I want to kill the server, install the new program, and execute it. However, the server might have batch jobs running, and I wish to leave them intact, but as 'child processes' of the original batch server, they cause the error message "internet domain bind: Address already in use" when I try to restart a new server. Is there any way to prevent children processes (created with fork/execl) from inheriting open/bound sockets? Is there any way to shutdown/unbind in the original server and children, so that the new server can bind to the same address? (If the answer is "shutdown()" then I used it incorrectly, and an example would be appreciated). I don't think that I want to use "setsockopt(... SO_REUSEADDR)" because then ANY other process would be able to bind to the port. Plus, I tried this, and could not get it to work. I need to see an example of how to use "setsockopt" if this is the answer. David W. Thomas dwthoma1@eos.ncsu.edu
Technical Details
Message-ID:
<1992Jul27.180950.3497@ncsu.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!gatech!taco!dwthoma1Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!taco!dwthoma1 From: dwthoma1@eos.ncsu.edu (DAVID W THOMAS) Subject: is there an unbind() command for sockets Message-ID: <1992Jul27.180950.3497@ncsu.edu> Originator: dwthoma1@c00041-118dan.eos.ncsu.edu Lines: 29 Sender: news@ncsu.edu (USENET News System) Reply-To: dwthoma1@eos.ncsu.edu (DAVID W THOMAS) Organization: North Carolina State University, Project Eos Date: Mon, 27 Jul 1992 18:09:50 GMT