Date: Fri, 21 Feb 1997 12:24:25 +1100 (EDT) From: Darren Reed <avalon@coombs.anu.edu.au> To: davidn@labs.usn.blaze.net.au (David Nugent) Cc: freebsd-hackers@freebsd.org Subject: Re: "connection refused" Message-ID: <199702210124.RAA23942@freefall.freebsd.org> In-Reply-To: <19970221082221.50024@usn.blaze.net.au> from "David Nugent" at Feb 21, 97 08:22:21 am
next in thread | previous in thread | raw e-mail | index | archive | help
In some mail from David Nugent, sie said: > > 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. Well, if you read the kernel source (tcp_input.c), it becomes more obvious about why you can't stop it before it goes "connection established". The socket is in LISTEN, packet comes in, gets bumped upto SYN_RECEIVED. and SYN-ACK is sent back (so the other side goes to ESTABLISHED). From my recollection of the code, there are no hooks for going to a user. Darren
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702210124.RAA23942>