Diagnosed Arc sharing issue in SocketBox cloning - complex race condition

Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-14 08:03:48 +00:00
parent 5730d2fa0f
commit e3be02db47
4 changed files with 83 additions and 2 deletions

23
test_socket_simple.nyash Normal file
View File

@ -0,0 +1,23 @@
// Simple test for SocketBox state sharing
static box Main {
main() {
print("🧪 Testing SocketBox state sharing...")
local socket
socket = new SocketBox()
print("Initial isServer: " + socket.isServer().toString())
local bindOk
bindOk = socket.bind("127.0.0.1", 8080)
print("Bind result: " + bindOk.toString())
print("After bind isServer: " + socket.isServer().toString())
local closeOk
closeOk = socket.close()
print("Close result: " + closeOk.toString())
return true
}
}