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

How to set SocketManager server options? #42

Open
MPuust opened this issue Mar 21, 2023 · 1 comment
Open

How to set SocketManager server options? #42

MPuust opened this issue Mar 21, 2023 · 1 comment

Comments

@MPuust
Copy link

MPuust commented Mar 21, 2023

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

@MPuust MPuust changed the title SocketManager pingTimeout? How to set SocketManager server options? Mar 21, 2023
@kodzonko
Copy link

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants