Crate quicksocket[][src]

Enums

MessagePayload

Valid message payloads in the list of messages to provide to try_send_message consist of strings (text messages) and bytes (binary messages).

Functions

PyInit_quicksocket

This autogenerated function is called by the python interpreter when importing the module.

drain_client_messages

Drains all messages pending from all clients and returns them as a list[bytes]. Note that clients are not distinguished, so clients will have to self-identify in their messages, or the library will need to change to return messages per-client or bundled with client connection info.

drain_new_client_events

Retrieves a List (Rust: Vec) of all new client connection events that have occurred since this function was last called.

get_last_error_string

Returns a string describing the nature of the last error the server encountered. No error has been detected if this function returns None.

is_server_running

Gets whether the server is running.

shutdown_server

Requests that the websocket server shut down. The server will not shut down immediately but will stop serving as soon as e.g. it processes the shutdown request and any existing network requests are resolved.

start_server

Starts the websocket server.

try_send_messages

Send messages to all connected clients. The socket stream is flushed after buffering each message in the argument List, so it’s better to call this once per ‘update,’ rather than calling this method multiple times if multiple messages are all available to be sent.