Inherits juce::Thread.
Asynchronous WebSocket client with non-blocking operations.
AsyncWebsocket provides a thread-safe, asynchronous interface to WebSocket connections. All network operations run on a background thread, ensuring that none of the public methods block the calling thread. All callbacks are delivered on the JUCE message thread for safe UI updates.
Key Features:
- Non-blocking connect, disconnect, and send operations
- Automatic ping/pong keep-alive with configurable interval
- Thread-safe message queuing for outgoing data
- Lambda-based callbacks on the message thread
- Support for both text and binary WebSocket messages
- Custom header support for authentication and protocols
Usage: Create an AsyncWebsocket with a URL, register callback handlers, then call connect(). The connection runs asynchronously on a background thread.
};
ws.onText = [](
const juce::String&
message) {
};
};
ws.send(
"Hello, server!");
Asynchronous WebSocket client with non-blocking operations.
Definition gin_asyncwebsocket.h:62
A lightweight 2D point class for projects that don't use juce_graphics.
Definition gin_point.h:25
Thread Safety:
- All public methods are thread-safe
- Callbacks execute on the JUCE message thread
- Internal message queue protected by critical section
- See also
- WebSocket, SecureStreamingSocket