From owner-freebsd-hackers Tue Jun 24 20:02:59 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id UAA25906 for hackers-outgoing; Tue, 24 Jun 1997 20:02:59 -0700 (PDT) Received: from shell.firehouse.net (brian@shell.firehouse.net [209.42.203.51]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id UAA25899 for ; Tue, 24 Jun 1997 20:02:47 -0700 (PDT) Received: from localhost (brian@localhost) by shell.firehouse.net (8.8.5/8.8.5) with SMTP id XAA14373; Tue, 24 Jun 1997 23:01:23 -0400 (EDT) Date: Tue, 24 Jun 1997 23:01:20 -0400 (EDT) From: Brian Mitchell To: Jaye Mathisen cc: Nadav Eiron , Adrian Chadd , 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 Tue, 24 Jun 1997, Jaye Mathisen wrote: When the peer closes a connection, read() should return 0 SOCK_STREAM only - for udp, I don;t think there is a really 100% reliable way to determine when the peer has shut down). > > Or netcat out of ports. It would probably work fine as well. > > On Sat, 21 Jun 1997, Nadav Eiron wrote: > > > > > > > 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? > > > > Why not just use plug-gw from the fwtk? From your description it sounds > > like just the thing you need. > > > > > > > > Thanks, > > > > > > -- > > > Adrian Chadd | "Unix doesn't stop you from doing > > > | stupid things because that would > > > | stop you from doing clever things" > > > > > > > > > > > Nadav > > > > Brian Mitchell brian@firehouse.net "BSD code sucks. Of course, everything else sucks far more." - Theo de Raadt