IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Re: Fun with sockets and select
If by an asynchronous request you mean non-blocking, then it is not reasonable to be expecting correct status. What asynchronous means is "do this for me, but come right back because I have other things to do". "I'll check back later to see how you did". A blocking request means do "this for me and I will wait until you do it or know why you can't".

It looks like Solaris is simply doing a blocking request, i.e. it's *not* asynchronous.

I did some socket stuff in 1995 but I'm no socket guru.
Alex

Men never do evil so completely and cheerfully as when they do it from religious conviction. -- Blaise Pascal (1623-1662)
New Nope.
We're waiting after the connect() is issued for a certain delay (2 seconds in this case). During the delay, a connect signal can occur, or the wait can time out. At the end of the timeout, the code checks the exception mask to see if an exception occurred, or if the socket indicates write status.

Last night I discovered that EINPROGRESS on Linux will always eventually mean that the socket becomes writable -- an exception will never be set. You then have to check getsockopt(sock, SOL_SOCKET, SO_ERROR, &buf, &size) to see if a failed connection error was set. Really strange.
Regards,

-scott anderson
     Fun with sockets and select - (admin) - (2)
         Re: Fun with sockets and select - (a6l6e6x) - (1)
             Nope. - (admin)

Secret sauce.
74 ms