Skip to content

[feature] Shutting down websocket #97

Open

Description

@habi498

Is your feature request related to a problem? Please describe.
I was trying to integrate websocket server inside squirrel via its api. I created function StartWebsocketServer(host, port, timeout);
Then i see that users cannot close it.

Describe the solution you'd like
I like to have a function ws_shutdown() which will shut everything down, stop the threads, close the sockets.

Describe alternatives you've considered
I considered alternative as manually close port on ws.c

Additional context

Activity

  1. Theldus commented on Sep 11, 2024

    @Theldus
    Owner

    Hi @habi498,
    This is a long standing feature requested for a few years, since issue #31 at least.

    I haven't implemented it yet because I'm not sure on how to do it: whether I should gracefully close each client connection, or if it's 'ok' to just abruptly close connections. Since wsServer is advertised as RFC 6455-compliant, these are questions that concern me a bit about how to approach this.

    I still want to implement it, and I want to see how other big and reference libraries do it, if most of them just abruptly close the connections, I won't have a problem doing that either =).

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions