Provides a WebRTC signaling server that Interface clients can use to initiate WebRTC connections to the domain server and its assignment clients. More...
#include <WebRTCSignalingServer.h>
Inherits QObject.
Public Slots | |
void | sendMessage (const QJsonObject &message) |
Send a WebRTC signaling channel message to an Interface client. More... | |
Signals | |
void | messageReceived (const QJsonObject &message) |
A WebRTC signaling channel message was received from an Interface client. More... | |
Public Member Functions | |
WebRTCSignalingServer (QObject *parent, bool isWSSEnabled) | |
Constructs a new WebRTCSignalingServer object. More... | |
bool | bind (const QHostAddress &address, quint16 port) |
Binds the WebRTC signaling server's WebSocket to an address and port. More... | |
Provides a WebRTC signaling server that Interface clients can use to initiate WebRTC connections to the domain server and its assignment clients.
The signaling server is expected to be hosted in the domain server. It provides a WebSocket for Interface clients to use in the WebRTC signaling handshake process to establish WebRTC data channel connections to each of the domain server and the assignment clients (i.e., separate WebRTC data channels for each but only a single signaling WebSocket). The assignment client signaling messages are expected to be relayed - by the domain server - via Overte protocol messages on the UDP connections between the domain server and assignment clients.
Additionally, for debugging purposes, instead of containing a WebRTC payload a signaling message may be an echo request. This is bounced back to the client from the WebRTCSignalingServer if the domain server was the target, otherwise it is expected to be bounced back upon receipt by the relevant assignment client.
The signaling messages are sent and received as JSON objects, with to
and from
fields in addition to either the WebRTC signaling data
payload or an echo
request:
Interface -> Server | |
---|---|
to | NodeType |
from | WebSocket IP address & port, "n.n.n.n:n" |
[data ] | WebRTC signaling payload |
[echo ] | Echo request |
*
The from
field is filled in upon receipt by the WebRTCSignalingServer.
Server -> Interface | |
---|---|
to | WebSocket IP address & port, "n.n.n.n:n" |
from | NodeType |
[data ] | WebRTC signaling payload |
[echo ] | Echo response |
WebRTCSignalingServer::WebRTCSignalingServer | ( | QObject * | parent, |
bool | isWSSEnabled | ||
) |
Constructs a new WebRTCSignalingServer object.
parent | Qt parent object. |
isWSSEnabled | Whether the WebSocket used for WebRTC signaling should be secure (WSS protocol). |
bool WebRTCSignalingServer::bind | ( | const QHostAddress & | address, |
quint16 | port | ||
) |
Binds the WebRTC signaling server's WebSocket to an address and port.
address | The address to use for the WebSocket. |
port | The port to use for the WebSocket. |
true
if the WebSocket was successfully bound, false
if it wasn't.
|
signal |
A WebRTC signaling channel message was received from an Interface client.
message | The message received from the Interface client. Includes details of the sender and the destination in addition to the WebRTC signaling channel payload. Not emitted if the message was an echo request for the domain server. |
|
slot |
Send a WebRTC signaling channel message to an Interface client.
message | The message to send to the Interface client. Includes details of the sender and the destination in addition to the WebRTC signaling channel payload. |