Re: xinetd client disconnects
- From: Martin Gregorie <martin@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 30 Jun 2011 21:23:15 +0000 (UTC)
On Thu, 30 Jun 2011 02:26:15 +0100, Tarim wrote:
Martin Gregorie wrote:I thought that too, so I double checked my memory with reference to some
> You get a zero response from recv() when the client closes the
You don't get to see the socket itself with an xinetd server as
xinetd wraps it all up and hands it to the server on stdin and stdout -
which is very handy if you don't want to do anything fancy.
code I wrote a while back.
It was written for xinetd and run under it to check what needed to be
done to write a simple, reliable start-on-demand server. It uses
recv(0, &buff, lth) to read messages, so its sucking on fd0 as though its
a socket. This works, as I said, with recv() returning zero when the
client closes the connector. It uses essentially the same trick to send
replies calling send(1, buff, lth) to push stuff down fd1.
martin@ | Martin Gregorie
gregorie. | Essex, UK
- Prev by Date: Re: [OT] computer running hot advice
- Next by Date: Re: [OT] computer running hot advice
- Previous by thread: Re: xinetd client disconnects
- Next by thread: Re: xinetd client disconnects