Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Feb 1997 12:02:13 -0800 (PST)
From:      John-Mark Gurney <jmg@nike.efn.org>
To:        David Nugent <davidn@labs.usn.blaze.net.au>
Cc:        Darren Reed <avalon@coombs.anu.edu.au>, freebsd-hackers@freebsd.org
Subject:   Re: "connection refused"
Message-ID:  <Pine.BSF.3.95q.970220114101.348E-100000@hydrogen.nike.efn.org>
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:

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




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