mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-11-29 09:14:13 +00:00
Use SO_RCVTIMEO to avoid the overhead of an extra syscall per packet
This commit is contained in:
1 parent
a9438d1f5e
commit
6e7965f013
5 files changed
+71
-21
No files matched your search
@@ -10,6 +10,7 @@
|
||||
#define LastSocketError() WSAGetLastError()
|
||||
|
||||
#define SHUT_RDWR SD_BOTH
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
|
||||
typedef int SOCK_RET;
|
||||
typedef int SOCKADDR_LEN;
|
||||
@@ -67,7 +68,8 @@ void addrToUrlSafeString(struct sockaddr_storage* addr, char* string);
|
||||
SOCKET connectTcpSocket(struct sockaddr_storage* dstaddr, SOCKADDR_LEN addrlen, unsigned short port, int timeoutSec);
|
||||
SOCKET bindUdpSocket(int addrfamily, int bufferSize);
|
||||
int enableNoDelay(SOCKET s);
|
||||
int recvUdpSocket(SOCKET s, char* buffer, int size);
|
||||
int recvUdpSocket(SOCKET s, char* buffer, int size, int useSelect);
|
||||
void shutdownTcpSocket(SOCKET s);
|
||||
int setNonFatalRecvTimeoutMs(SOCKET s, int timeoutMs);
|
||||
void setRecvTimeout(SOCKET s, int timeoutSec);
|
||||
void closeSocket(SOCKET s);
|
||||
Reference in new issue
Block a user