Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jun 1997 07:31:51 -0400 (EDT)
From:      Drew Derbyshire <ahd@kew.com>
To:        adrian@deathstar.ml.org, freebsd-hackers@FreeBSD.ORG
Subject:   Re: socket redirector
Message-ID:  <199706201131.HAA02285@pandora.hh.kew.com>

next in thread | raw e-mail | index | archive | help
> From: Adrian Chadd <adrian@deathstar.ml.org>
> I'm writing a quick socket redirector for something. Its run out of inetd,
> and basically opens a socket somewhere and acts as a pipe between the two.
> I'm using select(), and its working fine. The only problem I'm having is
> that I don't know how to tell when the remote end closes the connection
> down, so that I can just close everything down, and quit.
>
> Any ideas on how I'd do this?

Get this from the distribution:

	socket-1.1          create tcp socket and connect to stdin/out

Note that I have loaded it but not tested it.

To answer the source question, I think it's wait for the socket to
go ready on read, and a zero byte read is EOD, just like a file.

-ahd-



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706201131.HAA02285>