From owner-freebsd-hackers Fri Jun 20 09:06:48 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id JAA09336 for hackers-outgoing; Fri, 20 Jun 1997 09:06:48 -0700 (PDT) Received: from misery.sdf.com (misery.sdf.com [204.244.210.193]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id JAA09309 for ; Fri, 20 Jun 1997 09:06:33 -0700 (PDT) Received: from tom by misery.sdf.com with smtp (Exim 1.62 #1) id 0wf69f-0004B5-00; Fri, 20 Jun 1997 09:03:19 -0700 Date: Fri, 20 Jun 1997 09:03:19 -0700 (PDT) From: Tom Samplonius To: Adrian Chadd cc: freebsd-hackers@freebsd.org Subject: Re: socket redirector In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Fri, 20 Jun 1997, Adrian Chadd wrote: > Hey guys. > > 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? > > Thanks, > > -- > Adrian Chadd | "Unix doesn't stop you from doing > | stupid things because that would > | stop you from doing clever things" I use netcat from ports to do this, and it can tell. Tom