We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using "colyseus.js": "^0.14.13".
When the player disconnects from the network, execute room.send(...) console will log "WebSocket is already in CLOSING or CLOSED" error.
room.send(...)
For catching this error and close game. I have tried to use room.onError, room.connection.events.onclose and window.onerror, they're not working.
room.onError
room.connection.events.onclose
window.onerror
I found that error occurred in src/transport/WebSocketTransport.ts
src/transport/WebSocketTransport.ts
const _send = ws.send; ws.send = function (data: ArrayBuffer) { if (ws.readyState == 1) { bytesSent += data.byteLength; } _send.call(ws, data); }
Then I found this issue close not called if a client disconnects due to network failure in websockets.
So I have to check websockets.readyState before room.send everytime.
websockets.readyState
room.send
I found ws object is exposed in WebSocketTransport, but ITransport interface not define this type.
WebSocketTransport
ITransport
Please update ITransport interface for checking ws connection status.
PS: I am not a native English speaker. If there are any grammar errors, please forgive me
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am using "colyseus.js": "^0.14.13".
When the player disconnects from the network, execute
room.send(...)
console will log "WebSocket is already in CLOSING or CLOSED" error.For catching this error and close game. I have tried to use
room.onError
,room.connection.events.onclose
andwindow.onerror
, they're not working.I found that error occurred in
src/transport/WebSocketTransport.ts
Then I found this issue close not called if a client disconnects due to network failure in websockets.
So I have to check
websockets.readyState
beforeroom.send
everytime.I found ws object is exposed in
WebSocketTransport
, butITransport
interface not define this type.Please update
ITransport
interface for checking ws connection status.PS: I am not a native English speaker. If there are any grammar errors, please forgive me
The text was updated successfully, but these errors were encountered: