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:
23
test_socket_simple.nyash
Normal file
23
test_socket_simple.nyash
Normal 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user