[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to make kernel release socket..

> I try to implement server program for specific purpose.
> If the server is killed, I found that the server can't binding again
> the socket for about 1 min.
> How to make kernel release socket, instantaneously, when the
> process killed?
> In addition, when the client is died without closing socket,
> I found that the server receive "SIGPIPE" and then server died..
> How can we make the server ignore the "SIGPIPE" signal...

First, could you please avoid MIME messages to the list? Please...

Second, I guess you need some book on networking and UNIX system calls.
Killing the server means sending some signal to the process, like SIGINT.
To shut server cleanly, you have to close() socket before exit().
Use signal() to create a handler for a specific signal for that.

AS for the server dying on client closing the connection, I guess this is
more then acceptable behavior. (you are doing fork() upon accepting a
connection, don't you? in this case only child serving the connection will

Alex Y.
 _( )_
(     (o___           +-------------------------------------------+
 |      _ 7           |            Alexander Yukhimets            |
  \    (")            |       http://pages.nyu.edu/~aqy6633/      |
  /     \ \           +-------------------------------------------+

To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: