mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-27 04:48: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) {
|
if (err > 0) {
|
||||||
char dummy;
|
char dummy;
|
||||||
/* try reading so that errno is set */
|
/* try reading so that errno is set */
|
||||||
if (recv(sock, &dummy, 0, 0) < 0) return IO_ERROR;
|
if (recv(sock, &dummy, 0, 0) < 0 && errno != EAGAIN)
|
||||||
return IO_DONE;
|
return IO_ERROR;
|
||||||
|
else return IO_DONE;
|
||||||
/* if no event happened, there was a timeout */
|
/* if no event happened, there was a timeout */
|
||||||
} else return IO_TIMEOUT;
|
} else return IO_TIMEOUT;
|
||||||
/* otherwise connection succeeded */
|
/* otherwise connection succeeded */
|
||||||
|
Loading…
Reference in New Issue
Block a user