mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
Handle EINTR to fix streaming with GDB attached
This commit is contained in:
parent
72bbbb7549
commit
feb46b978e
@ -89,6 +89,7 @@ int recvUdpSocket(SOCKET s, char* buffer, int size, int useSelect) {
|
||||
err = (int)recv(s, buffer, size, 0);
|
||||
if (err < 0 &&
|
||||
(LastSocketError() == EWOULDBLOCK ||
|
||||
LastSocketError() == EINTR ||
|
||||
LastSocketError() == EAGAIN)) {
|
||||
// Return 0 for timeout
|
||||
return 0;
|
||||
|
@ -12,6 +12,7 @@
|
||||
#define SHUT_RDWR SD_BOTH
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#define EAGAIN WSAEWOULDBLOCK
|
||||
#define EINTR WSAEINTR
|
||||
|
||||
typedef int SOCK_RET;
|
||||
typedef int SOCKADDR_LEN;
|
||||
@ -53,8 +54,10 @@ typedef socklen_t SOCKADDR_LEN;
|
||||
#define TCP_NODELAY SCE_NET_TCP_NODELAY
|
||||
#undef EAGAIN
|
||||
#undef EWOULDBLOCK
|
||||
#undef EINTR
|
||||
#define EAGAIN SCE_NET_EAGAIN
|
||||
#define EWOULDBLOCK SCE_NET_EWOULDBLOCK
|
||||
#define EINTR SCE_NET_EINTR
|
||||
|
||||
#define sockaddr_in6 sockaddr_in
|
||||
#define sin6_addr sin_addr
|
||||
|
Loading…
x
Reference in New Issue
Block a user