WebSocket client that implements the NDEVR communication protocol over a QWebSocket.
More...
|
| | AdaptiveWebClient (QObject *parent=nullptr) |
| | Constructs the WebSocket client.
|
| virtual uint08 | bytesAvailable (void *socket) override |
| | Returns the number of bytes available for reading.
|
| void * | connectTo (const NDEVRServerInfo &info) override |
| | Establishes a connection to the specified server.
|
| void | connectToServer (const StringView &host, uint04 port, bool secure) |
| | Initiates a WebSocket connection to the specified host and port.
|
| virtual void | disconnectFrom (void *socket) override |
| | Disconnects from the specified socket.
|
| virtual bool | isOpen (void *socket=nullptr) const override |
| | Checks whether the socket is currently connected.
|
| virtual uint08 | rx (void *socket, NDEVRDataPacket &packet) override |
| | Receives data from the socket into a packet.
|
| virtual uint08 | tx (void *socket, NDEVRDataPacket &packet, uint08 size) override |
| | Transmits packet data through the socket.
|
| void | updateWindowSize (NDEVRConnectionData &state) override |
| | Updates the protocol window size for flow control.
|
| virtual void | wait (const TimeSpan &span, LogPtr log=nullptr) override |
| | Waits for the specified time span, processing events.
|
|
|
bool | m_is_open_received = false |
| | Whether the connected signal has been received.
|
|
QTimer | m_reconnect_timer |
| | Timer for automatic reconnection attempts.
|
|
QTimer | m_send_timer |
| | Timer for periodic send buffer flushing.
|
|
QWebSocket * | m_server_socket |
| | The underlying WebSocket.
|
|
bool | m_should_be_open = false |
| | Whether the connection should be open.
|
WebSocket client that implements the NDEVR communication protocol over a QWebSocket.
Provides automatic reconnection, buffered sending, and integrates with the NDEVRCommunicationLogic framework for binary message-based data transfer.
Definition at line 14 of file AdaptiveWebClient.h.
◆ AdaptiveWebClient()
| AdaptiveWebClient::AdaptiveWebClient |
( |
QObject * | parent = nullptr | ) |
|
|
explicit |
Constructs the WebSocket client.
- Parameters
-
| [in] | parent | Optional parent QObject. |
◆ bytesAvailable()
| virtual uint08 AdaptiveWebClient::bytesAvailable |
( |
void * | socket | ) |
|
|
overridevirtual |
Returns the number of bytes available for reading.
- Parameters
-
| [in] | socket | The socket to check. |
- Returns
- The number of bytes available.
◆ connectTo()
Establishes a connection to the specified server.
- Parameters
-
| [in] | info | The server information to connect to. |
- Returns
- An opaque pointer to the connection socket.
◆ connectToServer()
| void AdaptiveWebClient::connectToServer |
( |
const StringView & | host, |
|
|
uint04 | port, |
|
|
bool | secure ) |
Initiates a WebSocket connection to the specified host and port.
- Parameters
-
| [in] | host | The hostname or IP address to connect to. |
| [in] | port | The port number. |
| [in] | secure | Whether to use a secure (wss://) connection. |
◆ disconnectFrom()
| virtual void AdaptiveWebClient::disconnectFrom |
( |
void * | socket | ) |
|
|
overridevirtual |
Disconnects from the specified socket.
- Parameters
-
| [in] | socket | The socket to disconnect. |
◆ isOpen()
| virtual bool AdaptiveWebClient::isOpen |
( |
void * | socket = nullptr | ) |
const |
|
overridevirtual |
Checks whether the socket is currently connected.
- Parameters
-
| [in] | socket | The socket to check, or nullptr for the default. |
- Returns
- True if the connection is open.
◆ rx()
| virtual uint08 AdaptiveWebClient::rx |
( |
void * | socket, |
|
|
NDEVRDataPacket & | packet ) |
|
overridevirtual |
Receives data from the socket into a packet.
- Parameters
-
| [in] | socket | The socket to receive from. |
| [in] | packet | The packet buffer to fill. |
- Returns
- The number of bytes received.
◆ tx()
| virtual uint08 AdaptiveWebClient::tx |
( |
void * | socket, |
|
|
NDEVRDataPacket & | packet, |
|
|
uint08 | size ) |
|
overridevirtual |
Transmits packet data through the socket.
- Parameters
-
| [in] | socket | The socket to send through. |
| [in] | packet | The packet data to send. |
| [in] | size | The number of bytes to send. |
- Returns
- The number of bytes sent.
◆ updateWindowSize()
Updates the protocol window size for flow control.
- Parameters
-
| [in] | state | The connection state to update. |
◆ wait()
| virtual void AdaptiveWebClient::wait |
( |
const TimeSpan & | span, |
|
|
LogPtr | log = nullptr ) |
|
overridevirtual |
Waits for the specified time span, processing events.
- Parameters
-
| [in] | span | The duration to wait. |
| [in] | log | Optional log for progress reporting. |
The documentation for this class was generated from the following file: