What is GameLiftWebSocket?

0

Hello, our team using gamelift with unity engine(use gamelift sdk 5.1.2). I was always using GameLift well, but one day I sent a session creation request, and the session was created, but it ended right away.

Looking at the log, I saw the phrases

"INFO Aws.Gamelift.Server.GameLiftWebSocket (null) - Socket ***** is disconnected. Status Code: '0', Reason: '1' ",

"DEBUG Aws.Gamelift.Server.GameLiftWebSocket (null) - Not scheduling re-connect logic for non-current socket",

"DEBUG Aws.Gamelift.Server.GameLiftWebSocket (null) - Completed Disconnect. socket state is: Closed".

were the last phrases, and no logs were recorded on the instance for about 11 minutes after that. And in the meantime, the session wasn't running properly. Only after 11 minutes had passed and a new log was recorded, the session was created without a problem.

What is the GameLiftWebSocket? And how can i fix this problem?

owen
asked 22 days ago42 views
1 Answer
0

The GameLiftWebSocket in your logs refers to the underlying WebSocket connection used by the AWS GameLift server SDK to communicate with the GameLift service. This connection is crucial for receiving and sending updates about the game session, such as player connections, session termination, and other game server lifecycle events.

Socket Disconnection:

The log message "Socket ***** is disconnected. Status Code: '0', Reason: '1'" indicates that the WebSocket connection between your game server and GameLift was unexpectedly disconnected. The Status Code: '0' and Reason: '1' suggest a disconnect, but without specific details on the cause. Generally, a status code of 0 can indicate a normal closure, but the disconnection reason being 1 might indicate an unexpected or abrupt closure, possibly due to network issues or server resource constraints. Not Scheduling Re-connect Logic:

The log "Not scheduling re-connect logic for non-current socket" indicates that the server SDK chose not to attempt a reconnection for this specific WebSocket instance, possibly because it was handling or initiating a new connection. Completed Disconnect:

"Completed Disconnect. socket state is: Closed" confirms that the WebSocket has fully closed, and the SDK will not attempt to reuse it.

To troubleshoot,

Check Network and Instance Health:

Monitor the network stability and resource utilization (CPU, memory, etc.) on your game server instances. Use AWS CloudWatch to check for any unusual patterns around the time the issue occurred.

Enable Detailed Logs:

Ensure that detailed logging is enabled for both your game server and the GameLift service to capture more information if the issue recurs.

Handle WebSocket Disconnects Gracefully:

Ensure that your game server code can handle WebSocket disconnects by either attempting to reconnect or safely terminating the session. This might involve implementing more robust error handling and reconnection logic.

Upgrade or Patch SDK:

Check if there is a newer version of the GameLift SDK than 5.1.2 that might address this issue. AWS regularly updates SDKs to fix bugs and improve stability.

Test in Different Regions:

If possible, test the deployment in a different AWS region to rule out region-specific issues.

profile pictureAWS
EXPERT
Deeksha
answered 22 days ago
profile picture
EXPERT
reviewed 7 days ago
  • Thank you for answer! But i have one another question. Can i set scheduling logic for GameLiftWebSocket?

    "Not scheduling re-connect logic for non-current socket"

    Looking at the above sentence, it seems like I can set it

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions