From owner-freebsd-hackers Thu Feb 20 12:47:07 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id MAA07171 for hackers-outgoing; Thu, 20 Feb 1997 12:47:07 -0800 (PST) Received: from cheops.anu.edu.au (avalon@cheops.anu.edu.au [150.203.76.24]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id MAA07140 for ; Thu, 20 Feb 1997 12:46:35 -0800 (PST) Message-Id: <199702202046.MAA07140@freefall.freebsd.org> Received: by cheops.anu.edu.au (1.37.109.16/16.2) id AA087011573; Fri, 21 Feb 1997 07:46:13 +1100 From: Darren Reed Subject: Re: "connection refused" To: gurney_j@resnet.uoregon.edu Date: Fri, 21 Feb 1997 07:46:13 +1100 (EDT) Cc: davidn@labs.usn.blaze.net.au, avalon@coombs.anu.edu.au, freebsd-hackers@freebsd.org In-Reply-To: from "John-Mark Gurney" at Feb 20, 97 12:02:13 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In some mail from John-Mark Gurney, sie said: > > 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)... What about if the socket accept() is using is non-blocking ? Darren