Le Samedi 13 Mai 2006 02:49, Perry Lorier a écrit :
> How would this work as a nonblocking connect?  A lot of network
> services can't afford to block, they have other sockets to service. 
> Would it return an fd_set? maybe a poll array?  Maybe it would
> integrate with linux's epoll(), or freebsd's kqueue()?

Using three functions calls (non-blocking initiation, non-blocking 
status check and memory resource free) could easily allow for such a 
scheme to integrate within a (p)select(), epoll() or kqueue() loop.

Integrating with (p)poll() is more complicated because you have to know 
the exact number of entries in advance, but could probably be done as 
well.

There are possibly more troublesome issues:
1/ how to handle UDP, which is also supported by getaddrinfo(), and has 
more varied usages (not just socket() then connect())?

2/ how do you account for socket options, some of which MUST be defined 
before connect()/bind(), but obviously after socket()? it is my 
understanding that a wrapper as the one hereby suggested would hide 
socket() AND connect() within a single API call.

-- 
Rémi Denis-Courmont
http://www.simphalempin.com/home/

Attachment: pgpfQLYWjMY3W.pgp
Description: PGP signature

--------------------------------------------------------------------
IETF IPv6 working group mailing list
ipv6@ietf.org
Administrative Requests: https://www1.ietf.org/mailman/listinfo/ipv6
--------------------------------------------------------------------

Reply via email to