mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-26 12:28:21 +01:00
Still needs testing, but "worked" in Linux.
This commit is contained in:
parent
c8d58798f0
commit
51fcb5a7bd
@ -84,8 +84,9 @@ int sock_connect(p_sock ps, SA *addr, socklen_t addr_len, int timeout)
|
||||
if (err > 0) {
|
||||
char dummy;
|
||||
/* try reading so that errno is set */
|
||||
if (recv(sock, &dummy, 0, 0) < 0) return IO_ERROR;
|
||||
return IO_DONE;
|
||||
if (recv(sock, &dummy, 0, 0) < 0 && errno != EAGAIN)
|
||||
return IO_ERROR;
|
||||
else return IO_DONE;
|
||||
/* if no event happened, there was a timeout */
|
||||
} else return IO_TIMEOUT;
|
||||
/* otherwise connection succeeded */
|
||||
|
Loading…
Reference in New Issue
Block a user