Re: Issuing connect(2) after select(2) on non-blocking socket
Re: Issuing connect(2) after select(2) on non-blocking socket
- Subject: Re: Issuing connect(2) after select(2) on non-blocking socket
- From: Dado Colussi <email@hidden>
- Date: Mon, 26 Jun 2017 17:37:10 -0500
>
> After the connect() returns EINPROGRESS, and after the select() indicates
> 1 descriptor ready for write, getsockopt() returns status=0, errno=0:
>
> status = getsockopt(sockfd,SOL_SOCKET,SO_ERROR,&error,&len);
>
getsockopt() returns 0 on successful retrieval of the option value. So
that's good.
The option value is stored in memory pointed to by the fourth parameter
(named 'error', above). Hence the variable error == ECONNREFUSED.
Dado
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden