This class provides an interface for the JSON servers. More...
Header: | #include <TransportInterface> |
Inherits: | |
Inherited By: | nymeaserver::BluetoothServer, nymeaserver::TcpServer, and nymeaserver::WebSocketServer |
TransportInterface(const ServerConfiguration & config, QObject * parent = nullptr) | |
virtual | ~TransportInterface() = 0 |
ServerConfiguration | configuration() const |
virtual void | sendData(const QUuid & clientId, const QByteArray & data) = 0 |
virtual void | sendData(const QList<QUuid> & clients, const QByteArray & data) = 0 |
void | setConfiguration(const ServerConfiguration & config) |
virtual void | terminateClientConnection(const QUuid & clientId) = 0 |
virtual void | setServerName(const QString & serverName) |
virtual bool | startServer() = 0 |
virtual bool | stopServer() = 0 |
void | clientConnected(const QUuid & clientId) |
void | clientDisconnected(const QUuid & clientId) |
void | dataAvailable(const QUuid & clientId, const QByteArray & data) |
This class provides an interface for the JSON servers.
See also WebSocketServer and TcpServer.
Constructs a TransportInterface with the given config and parent.
[pure virtual]
TransportInterface::~TransportInterface()Virtual destructor for TransportInterface.
[signal]
void TransportInterface::clientConnected(const QUuid & clientId)This signal is emitted when a new client with the given clientId has been connected.
See also WebSocketServer and TcpServer.
[signal]
void TransportInterface::clientDisconnected(const QUuid & clientId)This signal is emitted when a new client with the given clientId has been disconnected.
See also WebSocketServer and TcpServer.
Returns the {ServerConfiguration}.
See also setConfiguration().
[signal]
void TransportInterface::dataAvailable(const QUuid & clientId, const QByteArray & data)This signal is emitted when valid data from the client with the given clientId are available.
See also WebSocketServer, TcpServer, and BluetoothServer.
[pure virtual]
void TransportInterface::sendData(const QUuid & clientId, const QByteArray & data)Pure virtual method for sending data to the client with the id clientId over the corresponding TransportInterface.
[pure virtual]
void TransportInterface::sendData(const QList<QUuid> & clients, const QByteArray & data)Pure virtual method for sending data to clients over the corresponding TransportInterface.
Set the ServerConfiguration of this TransportInterface to the given config.
See also configuration().
[virtual slot]
void TransportInterface::setServerName(const QString & serverName)Set the name of this TransportInterface to the given serverName.
[pure virtual slot]
bool TransportInterface::startServer()Pure virtual public slot for starting the corresponding TransportInterface. Returns true if started successfully.
See also WebSocketServer::startServer() and TcpServer::startServer().
[pure virtual slot]
bool TransportInterface::stopServer()Pure virtual public slot for stopping the corresponding TransportInterface. Returns true if stopped successfully.
See also WebSocketServer::stopServer() and TcpServer::stopServer().
[pure virtual]
void TransportInterface::terminateClientConnection(const QUuid & clientId)Pure virtual method for terminating clients connection. The JSON RPC server might call this when a client violates the protocol. Transports should immediately abort the connection to the client.