Skip to content

Quick Socket Disconnection Detection in SocketIOClient #394

@kkkkorsun

Description

@kkkkorsun

Currently, I'm experiencing issues with slow disconnection detection in the SocketIOClient library. While the JavaScript Socket.IO client provides options like pingTimeout and pingInterval to configure how quickly connection loss is detected, these options seem to be missing in the C# implementation.

The ConnectionTimeout option only affects the initial connection and WebSocket upgrade, but not the ongoing connection monitoring. In our real-time application, we need to detect connection loss within 5-10 seconds, but currently it can take much longer.

Questions:

  1. Is there a built-in way to configure ping/pong timeout detection that I'm missing?
  2. Are there plans to implement pingTimeout and pingInterval options similar to the JavaScript client?
  3. If not, what would be the recommended approach to implement quick disconnection detection without manually tracking ping/pong timestamps?

Current workaround:
We're currently tracking the last ping/pong time manually and force-closing the socket if no ping is received within N seconds, but this feels like something that should be handled by the library itself.

Environment:

  • SocketIOClient version: 3.1.2
  • Unity/C# application

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions