Skip to content
New issue

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

The remote party closed the WebSocket connection without completing the close handshake #185

Open
endel opened this issue Mar 5, 2022 · 4 comments

Comments

@endel
Copy link
Member

endel commented Mar 5, 2022

Reported by @rakeshparihar on endel/NativeWebSocket#61

Using Reserve seat API to join in a room, and when there is a WebSocket connection drops unexpectedly, its not reconnecting and getting an error " The remote party closed the WebSocket connection without completing the close handshake." with error code : 1006.

Step to reproduce:

Join room by Seat reserve call - (Independent of matchmaking of Colyseus)

  • After successful seat reserve call
  • Ping pong should be started
  • Once get connected try to close the internet for a few seconds or if your internet gets disconnected for some reason.
  • you will get the issue right there
@AbhishekFYND
Copy link

Hi Any update on this issue? even we are also facing the same issue

@nuruddinwarsi
Copy link

nuruddinwarsi commented Mar 7, 2022

Hi, I am facing the same issue as well. Using an android build to test
Steps :

  • User disconnects internet on their device.
  • pingInterval: 15 and pingMaxRetries: 1. The server waits accordingly for that time and players are also shown in colyseus monitor panel.
  • However, on the client, the device's websocket connection is closed and abnormal code 1006 is thrown.
  • Client is unable to reconnect to the server and room, even though the server hasn't removed the player from the room (as seen in monitor panel)

PS: in the server's onLeave method, have added code to allow for reconnection

@endel
Copy link
Member Author

endel commented Mar 7, 2022

@AbhishekFYND Do you possibly have a small project where we can observe this problem? Do you also use the reconnection feature?

@nuruddinwarsi How does your onLeave() method look like? I've seen some people using .allowReconnection() without the await keyword, thus having unexpected behaviour

@nuruddinwarsi
Copy link

@endel

try {
if (consented) {
throw new Error(Player ${leavingPlayer.id} consented );
}
// 10 sec allowed to reconnect
await this.allowReconnection(client, GameRules.ReconnectionTime);
leavingPlayer.assign({
connected: true,
readyState: PlayerReadyState.READY,
});
} catch (ex) {
// code to remove player from state and declare winner
}

I have few concerns regarding my connection flow as well.
Server is using typescript / Node and client using Unity / C#

  • Instead of using joinById / create room from client side, I am using the match maker API to create seat reservation.
  • Send the seat reservation data to client using a middleware android app, which passes the data to unity client
  • The client then uses the consumeSeatReservation method

Is there a difference between using client side vs server side joinById method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants