aboutsummaryrefslogtreecommitdiff
path: root/src/core/internal_network/network.cpp
diff options
context:
space:
mode:
authorcirakg <cirakg@cirakg.xyz>2026-11-03 00:46:55 +0100
committercirakg <cirakg@cirakg.xyz>2026-11-03 00:46:55 +0100
commit36d3d002e5bd75596b8cf00c1115632a5ae8976a (patch)
treefb4c0238d24e2daab253dd4f209679bc3baf68ca /src/core/internal_network/network.cpp
parent2aa4b29c4544593cfe3d61f0db0ad45b58af4b28 (diff)
network: keep bsd sockets alive across concurrent close and fix room gaps
bsd runs on three host threads, but its calls kept a raw reference into the shared descriptor table while they used a socket. A close() on another thread could then destroy the socket mid-call. Waking a blocked room recv() on close made this happen every time. Every call now works on a copy of the descriptor taken under the table lock, poll() keeps its sockets alive while it waits, and close() resets the slot only if it still holds the same socket. accept() picked a free fd before blocking and only locked the write, so another thread could publish a socket in the same slot. It now picks and writes the fd in one critical section after Accept() returns. dup() now re-checks the source fd under the lock. A duplicated fd shares its socket, so the room packet loop queued each packet once per fd. Deliver it once per socket. NIFM: when the selected host adapter is missing, the room still works and IsNetworkAvailable reports it, but GetCurrentNetworkProfile returned an empty profile. Report a wired room profile in that case, and put the room address on the first adapter in EnumerateNetworkInterfaces. Assisted-by: Claude Opus 5.5 (investigation and implementation)
Diffstat (limited to 'src/core/internal_network/network.cpp')
0 files changed, 0 insertions, 0 deletions