From owner-freebsd-hackers Thu Feb 20 12:02:58 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id MAA04488 for hackers-outgoing; Thu, 20 Feb 1997 12:02:58 -0800 (PST) Received: from hydrogen.nike.efn.org (resnet.uoregon.edu [128.223.170.28]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id MAA04475 for ; Thu, 20 Feb 1997 12:02:46 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by hydrogen.nike.efn.org (8.8.4/8.8.4) with SMTP id MAA01237; Thu, 20 Feb 1997 12:02:13 -0800 (PST) Date: Thu, 20 Feb 1997 12:02:13 -0800 (PST) From: John-Mark Gurney Reply-To: John-Mark Gurney To: David Nugent cc: Darren Reed , freebsd-hackers@freebsd.org Subject: Re: "connection refused" In-Reply-To: <19970221004812.00805@usn.blaze.net.au> Message-ID: X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Fri, 21 Feb 1997, David Nugent wrote: > Hmm. Then I'll need multiple sockets, since there may be more > than one remote host. I guess that is feasible given that it > only moves the placement of fork(). But it also means leaving > around more processes just for enquiry. > > > What does it say before that ? A connection is ESTABLISHED before it > > comes back via accept(). > > Ok. Then recvmsg() should be used without (instead of) accept()? it seems that accept() does do what you want..... directly from the accept() man page: For certain protocols which require an explicit confirmation, such as ISO or DATAKIT, accept() can be thought of as merely dequeueing the next con- nection request and not implying confirmation. Confirmation can be im- plied by a normal read or write on the new file descriptor, and rejection can be implied by closing the new socket. it seems you can accept() a conntection... verify were it is coming from and then close and it will be rejected... as it turns out this isn't true... (I just wrote a test program to test it)... looks like either accept need to be fixed (to behave this way) or the docs should be updated... comments? John-Mark gurney_j@efn.org http://resnet.uoregon.edu/~gurney_j/ Modem/FAX: (541) 683-6954 (FreeBSD Box) Live in Peace, destroy Micro$oft, support free software, run FreeBSD (unix)