From 4d7e06541e5fab3492bd966e9502fae407c40105 Mon Sep 17 00:00:00 2001 From: jacob Date: Mon, 19 Jan 2026 21:11:32 -0600 Subject: [PATCH] formatting --- src/net/net_win32/net_win32.c | 55 ++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/src/net/net_win32/net_win32.c b/src/net/net_win32/net_win32.c index 1e5f5574..4c2e7d26 100644 --- a/src/net/net_win32/net_win32.c +++ b/src/net/net_win32/net_win32.c @@ -397,7 +397,7 @@ void NET_W32_TickForever(WaveLaneCtx *lane) //- Read incoming packets // TODO: Rate limit - // TODO: Per-frame recv limit to ensure other pipes are still serviced during load + // TODO: Per-frame recv limit to ensure pipes are still serviced during load { i64 wake_count = 0; @@ -629,7 +629,7 @@ void NET_W32_TickForever(WaveLaneCtx *lane) } ////////////////////////////// - //- Process pipes + //- Service pipes for (i64 pipe_idx = 0; pipe_idx < pipes_count; ++pipe_idx) { @@ -688,7 +688,6 @@ void NET_W32_TickForever(WaveLaneCtx *lane) SOCKET sock = 0; if (ok) { - // sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); sock = WSASocketW(ai->ai_family, ai->ai_socktype, ai->ai_protocol, 0, 0, WSA_FLAG_OVERLAPPED); ok = sock != INVALID_SOCKET; } @@ -742,7 +741,7 @@ void NET_W32_TickForever(WaveLaneCtx *lane) ok = bind(sock, ai->ai_addr, (i32)ai->ai_addrlen) == 0; } - //- Enable non-blocking + //- Disable blocking if (ok) { u_long nonblocking = 1; @@ -751,28 +750,32 @@ void NET_W32_TickForever(WaveLaneCtx *lane) //- Disable ICMP reporting { - DWORD bytes = 0; - b32 report = 0; - int rc = WSAIoctl( - sock, - SIO_UDP_CONNRESET, - &report, sizeof(report), - 0, 0, - &bytes, - 0, 0 - ); - } - { - DWORD bytes = 0; - b32 report = 0; - int rc = WSAIoctl( - sock, - SIO_UDP_NETRESET, - &report, sizeof(report), - 0, 0, - &bytes, - 0, 0 - ); + if (ok) + { + DWORD bytes = 0; + b32 report = 0; + ok = WSAIoctl( + sock, + SIO_UDP_CONNRESET, + &report, sizeof(report), + 0, 0, + &bytes, + 0, 0 + ) == 0; + } + if (ok) + { + DWORD bytes = 0; + b32 report = 0; + ok = WSAIoctl( + sock, + SIO_UDP_NETRESET, + &report, sizeof(report), + 0, 0, + &bytes, + 0, 0 + ) == 0; + } } //- Fetch bound port