* Mikko Ty�l�j�rvi <[EMAIL PROTECTED]> [001214 09:12] wrote:
> 
> AFAIK there is no portable way to reject incoming connections without
> calling accept().  However, accept(2) states:
> 
>      One can obtain user connection request data without confirming
>      the connection 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 providing only the
>      control information, or by calling setsockopt(2).
> 
> Is this really true?  A quick experiment with recvmsg() seems to
> indicate it is not, at least not for TCP sockets.

It's supposed to be used with the OSI protocols or something. :)

Adapting it to TCP would be nice, but the problem in FreeBSD at
least is that by the time a socket is in the listen queue is has
completed the TCP connection handshake.

> P.S. Anybody who claims that this works is encouraged to provide
>      proof in the form of code... :-)

hah.

-- 
-Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
"I have the heart of a child; I keep it in a jar on my desk."


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to