Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Feb 1997 10:48:37 -0700 (MST)
From:      Marc Slemko <marcs@znep.com>
To:        David Nugent <davidn@labs.usn.blaze.net.au>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: "connection refused"
Message-ID:  <Pine.BSF.3.95.970220095217.28954e-100000@alive.znep.com>
In-Reply-To: <19970221004812.00805@usn.blaze.net.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 21 Feb 1997, David Nugent wrote:

> On Feb 02, 1997 at 12:36:59AM, Darren Reed wrote:
> > >   One can obtain user connection request data without confirming the con-
> > >   nection by issuing a recvmsg(2) call with an msg_iovlen of 0 and a non-
> > >   zero msg_controllen, or by issuing a getsockopt(2) request.  Similarly,
> > >   one can provide user connection rejection information by issuing a
> > >   sendmsg(2) call with providing only the control information, or by call-
> > >   ing setsockopt(2).
> > > 
> > > Unless I'm reading this incorrectly, this is precisely what I'd like
> > > to do. I just can work out how to do it. :-)

See the paragraph before thst:

     For certain protocols which require an explicit confirmation,
     such as ISO or DATAKIT, accept() can be thought of as merely
     dequeueing the next connection request and not implying
     confirmation.  Confirmation can be implied by a normal read
     or write on the new file descriptor, and rejection can be
     implied by closing the new socket.

I think this was an addition to 4.4BSD (for ISO stuff?) and TCP
doesn't use it.  

> > 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()?

A connection is established before you call accept() (or before it
unblocks, if you called it earlier).  When you call listen() all
the connection establishment is done; anything you could setup
would need to be done before listen(), since after that the normal
processing automatically competes the three-way TCP handshake before
it is made available to accept().




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.970220095217.28954e-100000>