Skip to content

Commit

Permalink
Just to be safe since SO_MAX_MSG_SIZE may not be available on all pla…
Browse files Browse the repository at this point in the history
…tform and forcing the definition to what windows use might be a bad idea.
  • Loading branch information
anr2me committed Jul 23, 2020
1 parent 6f6d2cc commit 67c3712
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Core/HLE/proAdhoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
socklen_t m = sizeof(n);
#if defined(SO_MAX_MSG_SIZE) // May not be available on all platform
getsockopt(udpsock, SOL_SOCKET, SO_MAX_MSG_SIZE, (char*)&n, &m);
#endif
return n;
}

Expand Down

0 comments on commit 67c3712

Please sign in to comment.