You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* On UDP, a connreset simply means the previous send failed.
* So we try again.
* On TCP, it means our socket is now useless, so the error passes.
* (We will loop again, exiting because the same error will happen) */
as this in wsocket.c line 256 try again but may it missing continue ? prev still IO_DONE
in if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
int socket_recv(p_socket ps, char *data, size_t count, size_t *got,
p_timeout tm)
{
int err, prev = IO_DONE;
*got = 0;
if (*ps == SOCKET_INVALID) return IO_CLOSED;
for ( ;; ) {
int taken = recv(*ps, data, (int) count, 0);
if (taken > 0) {
*got = taken;
return IO_DONE;
}
if (taken == 0) return IO_CLOSED;
err = WSAGetLastError();
/* On UDP, a connreset simply means the previous send failed.
* So we try again.
* On TCP, it means our socket is now useless, so the error passes.
* (We will loop again, exiting because the same error will happen) */
if (err != WSAEWOULDBLOCK) {
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
prev = err;
//change by 2017-1-7 01:59:38 darklost.me
//settimeout(0) is always return IO_TIMEOUT when remote server is closed!
//maybe missing continue here?
continue;
}
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
}
}
in function int socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got, SA *addr, socklen_t *len, p_timeout tm) the same as above
may be missing continue ?
The text was updated successfully, but these errors were encountered:
as this in wsocket.c line 256 try again but may it missing continue ? prev still IO_DONE
in
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
in function
int socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got, SA *addr, socklen_t *len, p_timeout tm)
the same as abovemay be missing continue ?
The text was updated successfully, but these errors were encountered: