Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

How to set SocketManager server options? #42

Open

Description

@MPuust

Where to set pingTimeout for server https://socket.io/docs/v4/server-options/#pingtimeout ?

Activity

  1. changed the title [-]SocketManager pingTimeout?[/-] [+]How to set SocketManager server options?[/+] on Mar 21, 2023
  2. kodzonko commented on Aug 24, 2023

    @kodzonko

    you need to pass them as kwargs to SocketManager's initializer. Kwargs are then forwarded to socketio.AsyncServer's initializer. Here's the implementation:

    # SocketManager's initializer:
    def __init__(
            self,
            ...
            **kwargs
        ) -> None:
            self._sio = socketio.AsyncServer(async_mode=async_mode, cors_allowed_origins=cors_allowed_origins, **kwargs)
            ...

    And in AsyncServer you have all these params used both by Asyncserver and by EngineIO, among others ping_timeout (reference for parameters: https://python-socketio.readthedocs.io/en/latest/api.html#asyncserver-class)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions