Check for both EWOULDBLOCK and EAGAIN for OSes where those values differ
This commit is contained in:
parent
ebd0b2d3b1
commit
219d87486e
2 changed files with 4 additions and 1 deletions
|
|
@ -87,7 +87,9 @@ int recvUdpSocket(SOCKET s, char* buffer, int size, int useSelect) {
|
|||
// socket via SO_RCVTIMEO, so we can avoid a syscall
|
||||
// for each packet.
|
||||
err = (int)recv(s, buffer, size, 0);
|
||||
if (err < 0 && LastSocketError() == EWOULDBLOCK) {
|
||||
if (err < 0 &&
|
||||
(LastSocketError() == EWOULDBLOCK ||
|
||||
LastSocketError() == EAGAIN)) {
|
||||
// Return 0 for timeout
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#define SHUT_RDWR SD_BOTH
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#define EAGAIN WSAEWOULDBLOCK
|
||||
|
||||
typedef int SOCK_RET;
|
||||
typedef int SOCKADDR_LEN;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue