mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
Just to be safe since SO_MAX_MSG_SIZE may not be available on all platform and forcing the definition to what windows use might be a bad idea.
This commit is contained in:
parent
a3b21b04ea
commit
a6e3bed150
@ -1641,12 +1641,11 @@ uint16_t getLocalPort(int sock) {
|
||||
}
|
||||
|
||||
int getSockMaxSize(int udpsock) {
|
||||
#if !defined(SO_MAX_MSG_SIZE)
|
||||
#define SO_MAX_MSG_SIZE 0x2003
|
||||
#endif
|
||||
int n = 1500; // Typical MTU size as default
|
||||
#if defined(SO_MAX_MSG_SIZE) // May not be available on all platform
|
||||
socklen_t m = sizeof(n);
|
||||
getsockopt(udpsock, SOL_SOCKET, SO_MAX_MSG_SIZE, (char*)&n, &m);
|
||||
#endif
|
||||
return n;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user