2#include <NDEVR/NDEVRCommunicationLogic.h>
3#include <NDEVR/Buffer.h>
4#include <NDEVR/QueueBuffer.h>
5#include <NDEVR/Dictionary.h>
7#include <NDEVR/ApplicationOption.h>
8#include <QWebSocketServer>
9#include <NDEVR/TimeSpan.h>
10#include <QElapsedTimer>
17 class AdaptiveWebServer :
public QObject,
public NDEVRCommunicationLogic
31 String start(quint16 port);
32 virtual uint08 rx(
void* socket, NDEVRDataPacket& packet)
override;
33 virtual uint08 tx(
void* socket, NDEVRDataPacket& packet,
uint08 size)
override;
34 virtual uint08 bytesAvailable(
void* socket)
override;
36 virtual void wait(
const TimeSpan& span,
LogPtr log =
nullptr)
override;
38 virtual void disconnectFrom(
void* socket);
39 void setSocketServer(QWebSocketServer* server);
40 virtual bool isOpen(
void* socket =
nullptr)
const override;
50 void onBinaryMessageReceived(
const QByteArray& message,
bool last);
51 void onBinaryMessageSent(qint64 send_size);
53 void onNewConnection();
54 void onErrorOccurredSlot(QAbstractSocket::SocketError error);
57 QWebSocketServer* m_server =
nullptr;
WebSocket server implementation of NDEVRCommunicationLogic with optional SSL/TLS support.
static ApplicationOption< String > certificate_file
Path to the SSL certificate file.
PrivateKeyAlgorithm
Supported private key algorithms for SSL.
@ e_dh
Diffie-Hellman algorithm.
@ e_ec
Elliptic Curve algorithm.
@ e_opaque
Opaque key type.
static ApplicationOption< PrivateKeyAlgorithm > key_algorithm
Algorithm used for the private key.
static ApplicationOption< uint02 > default_port
Default listening port.
static ApplicationOption< bool > use_ssl
Whether to enable SSL/TLS.
static ApplicationOption< String > key_file
Path to the SSL private key file.
static ApplicationOption< TimeSpan > service_time
Interval between send ticks.
static ApplicationOption< uint08 > window_size
Default transmission window size.
The default object to store data of any type that should persist through sessions of the application.
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
The core String 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
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.