From owner-freebsd-hackers Thu Feb 20 13:23:14 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id NAA08720 for hackers-outgoing; Thu, 20 Feb 1997 13:23:14 -0800 (PST) Received: from labs.usn.blaze.net.au (labs.usn.blaze.net.au [203.17.53.30]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id NAA08691 for ; Thu, 20 Feb 1997 13:22:34 -0800 (PST) Received: (from davidn@localhost) by labs.usn.blaze.net.au (8.8.5/8.8.5) id IAA08218; Fri, 21 Feb 1997 08:22:22 +1100 (EST) Message-ID: <19970221082221.50024@usn.blaze.net.au> Date: Fri, 21 Feb 1997 08:22:21 +1100 From: David Nugent To: Darren Reed Cc: gurney_j@resnet.uoregon.edu, freebsd-hackers@freebsd.org Subject: Re: "connection refused" References: <199702202046.HAA03159@unique.usn.blaze.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.61 In-Reply-To: <199702202046.HAA03159@unique.usn.blaze.net.au>; from Darren Reed on Feb 02, 1997 at 07:46:13AM Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Feb 02, 1997 at 07:46:13AM, Darren Reed wrote: > In some mail from John-Mark Gurney, sie said: > > > 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. Yes, that's how I read it too, the first time. :) > > 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)... As did I, and hence my question. > What about if the socket accept() is using is non-blocking ? FWIW, the behaviour is the same and results in "connection closed by remote host" rather than "connection refused" as I would have expected. Regards, David Nugent - Unique Computing Pty Ltd - Melbourne, Australia Voice +61-3-9791-9547 Data/BBS +61-3-9792-3507 3:632/348@fidonet davidn@freebsd.org davidn@blaze.net.au http://www.blaze.net.au/~davidn/