2#include <NDEVR/NDEVRCommunicationLogic.h>
3#include <NDEVR/String.h>
4#include <NDEVR/QueueBuffer.h>
33 virtual uint08 rx(
void* socket, NDEVRDataPacket& packet)
override;
40 virtual uint08 tx(
void* socket, NDEVRDataPacket& packet,
uint08 size)
override;
50 virtual bool isOpen(
void* socket =
nullptr)
const override;
77 void onBinaryMessageReceived(
const QByteArray& message);
82 void onBinaryFrameReceived(
const QByteArray& message,
bool is_last);
86 void onBinaryMessageSent(qint64 message);
88 void onReconnectTimeout();
virtual uint08 bytesAvailable(void *socket) override
Returns the number of bytes available for reading.
QTimer m_reconnect_timer
Timer for automatic reconnection attempts.
virtual bool isOpen(void *socket=nullptr) const override
Checks whether the socket is currently connected.
QTimer m_send_timer
Timer for periodic send buffer flushing.
virtual uint08 rx(void *socket, NDEVRDataPacket &packet) override
Receives data from the socket into a packet.
void connectToServer(const StringView &host, uint04 port, bool secure)
Initiates a WebSocket connection to the specified host and port.
virtual void wait(const TimeSpan &span, LogPtr log=nullptr) override
Waits for the specified time span, processing events.
virtual uint08 tx(void *socket, NDEVRDataPacket &packet, uint08 size) override
Transmits packet data through the socket.
bool m_is_open_received
Whether the connected signal has been received.
virtual void disconnectFrom(void *socket) override
Disconnects from the specified socket.
AdaptiveWebClient(QObject *parent=nullptr)
Constructs the WebSocket client.
QWebSocket * m_server_socket
The underlying WebSocket.
bool m_should_be_open
Whether the connection should be open.
void updateWindowSize(NDEVRConnectionData &state) override
Updates the protocol window size for flow control.
void * connectTo(const NDEVRServerInfo &info) override
Establishes a connection to the specified server.
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
The core String View class for the NDEVR API.
Stores a time span, or difference between two times, with an optional start time.
The primary namespace for the NDEVR SDK.
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Holds the state of a single NDEVR network connection, including transmit and receive packets.
Contains the address, credentials, and security flag needed to connect to an NDEVR server.