Having problems understanding async_connect_send and async_connect_connected in lib/async_req/async_soc.c
Richard Sharpe
realrichardsharpe at gmail.com
Fri Oct 16 20:22:51 UTC 2015
Hi folks,
I am having problems reconciling this man connect with respect to EINPROGRESS:
The socket is non-blocking and the connection cannot be com-
pleted immediately. It is possible to select(2) or poll(2) for
completion by selecting the socket for writing. After select(2)
indicates writability, use getsockopt(2) to read the SO_ERROR
option at level SOL_SOCKET to determine whether connect() com-
pleted successfully (SO_ERROR is zero) or unsuccessfully
(SO_ERROR is one of the usual error codes listed here, explain-
ing the reason for the failure).
However, the code in async_connect_connected simply calls connect
again, which strace tells me is getting ECONNREFUSED ...
So, I am confused ...
Perhaps there is some missing code for the AF_INET case?
--
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)
More information about the samba-technical
mailing list