Merge pull request #20245 from ANR2MERefork/adhoc_socket

[Adhoc] Partially fixes multiplayer regression on GTA games.
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2025-04-13 13:30:10 +02:00
commit 182bb8ebf2
2 files changed
-12

No files matched your search

-4
View File
@@ -424,10 +424,6 @@ void deleteAllAdhocSockets() {
if (fd > 0) {
// Close Socket
struct linger sl {};
sl.l_onoff = 1; // non-zero value enables linger option in kernel
sl.l_linger = 0; // timeout interval in seconds
setsockopt(fd, SOL_SOCKET, SO_LINGER, (const char*)&sl, sizeof(sl));
shutdown(fd, SD_RECEIVE);
closesocket(fd);
}
-8
View File
@@ -2175,10 +2175,6 @@ int NetAdhocPdp_Delete(int id, int unknown) {
// Valid Socket
if (sock != NULL && sock->type == SOCK_PDP) {
// Close Connection
struct linger sl {};
sl.l_onoff = 1; // non-zero value enables linger option in kernel
sl.l_linger = 0; // timeout interval in seconds
setsockopt(sock->data.pdp.id, SOL_SOCKET, SO_LINGER, (const char*)&sl, sizeof(sl));
shutdown(sock->data.pdp.id, SD_RECEIVE);
closesocket(sock->data.pdp.id);
@@ -3873,10 +3869,6 @@ int NetAdhocPtp_Close(int id, int unknown) {
// Valid Socket
if (socket != NULL && socket->type == SOCK_PTP) {
// Close Connection
struct linger sl {};
sl.l_onoff = 1; // non-zero value enables linger option in kernel
sl.l_linger = 0; // timeout interval in seconds
setsockopt(socket->data.ptp.id, SOL_SOCKET, SO_LINGER, (const char*)&sl, sizeof(sl));
shutdown(socket->data.ptp.id, SD_RECEIVE);
closesocket(socket->data.ptp.id);