Skip to content

Commit

Permalink
Implement support for userbuffers on Wii U
Browse files Browse the repository at this point in the history
The Wii U socket implementation has limited memory available. To support larger receive buffers, application memory needs to be provided.
To make sockets use this user memory the `SO_RUSRBUF` option needs to be set on the socket.
  • Loading branch information
GaryOderNichts authored and cgutman committed Feb 18, 2024
1 parent 8af4562 commit 3d99869
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/PlatformSockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ SOCKET bindUdpSocket(int addressFamily, struct sockaddr_storage* localAddr, SOCK
Limelog("WSAIoctl(SIO_UDP_CONNRESET) failed: %d\n", LastSocketError());
}
}
#elif defined(__WIIU__)
{
// Enable usage of userbuffers on Wii U
int val = 1;
setsockopt(s, SOL_SOCKET, SO_RUSRBUF, &val, sizeof(val));
}
#endif

// Enable QOS for the socket (best effort)
Expand Down

0 comments on commit 3d99869

Please sign in to comment.