Overte C++ Documentation
WDCConnection Class Reference

A WebRTC data channel connection. More...

#include <WebRTCDataChannels.h>

Public Member Functions

 WDCConnection (WebRTCDataChannels *parent, const QString &dataChannelID)
 Constructs a new WDCConnection and opens a WebRTC data connection. More...
 
QString getDataChannelID () const
 Gets the data channel ID. More...
 
void setRemoteDescription (QJsonObject &description)
 Sets the remote session description received from the remote client via the signaling channel. More...
 
void createAnswer ()
 Creates an answer to an offer received from the remote client via the signaling channel.
 
void sendAnswer (webrtc::SessionDescriptionInterface *description)
 Sends an answer to the remote client via the signaling channel. More...
 
void setLocalDescription (webrtc::SessionDescriptionInterface *description)
 Sets the local session description on the WebRTC data channel being connected. More...
 
void addIceCandidate (QJsonObject &data)
 Adds an ICE candidate received from the remote client via the signaling channel. More...
 
void sendIceCandidate (const webrtc::IceCandidateInterface *candidate)
 Sends an ICE candidate to the remote client via the signaling channel. More...
 
void onPeerConnectionStateChanged (webrtc::PeerConnectionInterface::PeerConnectionState state)
 Monitors the peer connection state. More...
 
void onDataChannelOpened (rtc::scoped_refptr< webrtc::DataChannelInterface > dataChannel)
 Handles the WebRTC data channel being opened. More...
 
void onDataChannelStateChanged ()
 Handles a change in the state of the WebRTC data channel.
 
void onDataChannelMessageReceived (const webrtc::DataBuffer &buffer)
 Handles a message being received on the WebRTC data channel. More...
 
qint64 getBufferedAmount () const
 Gets the number of bytes waiting to be sent on the WebRTC data channel. More...
 
bool sendDataMessage (const webrtc::DataBuffer &buffer)
 Sends a message on the WebRTC data channel. More...
 
void closePeerConnection ()
 Closes the WebRTC peer connection.
 

Detailed Description

A WebRTC data channel connection.

Opens and manages a WebRTC data channel connection.

Constructor & Destructor Documentation

◆ WDCConnection()

WDCConnection::WDCConnection ( WebRTCDataChannels parent,
const QString &  dataChannelID 
)

Constructs a new WDCConnection and opens a WebRTC data connection.

Parameters
parentThe parent WebRTCDataChannels object.
dataChannelIDThe data channel ID.

Member Function Documentation

◆ addIceCandidate()

void WDCConnection::addIceCandidate ( QJsonObject &  data)

Adds an ICE candidate received from the remote client via the signaling channel.

Parameters
dataThe ICE candidate.

◆ getBufferedAmount()

qint64 WDCConnection::getBufferedAmount ( ) const

Gets the number of bytes waiting to be sent on the WebRTC data channel.

Returns
The number of bytes waiting to be sent on the WebRTC data channel.

◆ getDataChannelID()

QString WDCConnection::getDataChannelID ( ) const
inline

Gets the data channel ID.

Returns
The data channel ID.

◆ onDataChannelMessageReceived()

void WDCConnection::onDataChannelMessageReceived ( const webrtc::DataBuffer &  buffer)

Handles a message being received on the WebRTC data channel.

Parameters
bufferThe message received.

◆ onDataChannelOpened()

void WDCConnection::onDataChannelOpened ( rtc::scoped_refptr< webrtc::DataChannelInterface >  dataChannel)

Handles the WebRTC data channel being opened.

Parameters
dataChannelThe WebRTC data channel.

◆ onPeerConnectionStateChanged()

void WDCConnection::onPeerConnectionStateChanged ( webrtc::PeerConnectionInterface::PeerConnectionState  state)

Monitors the peer connection state.

Parameters
stateThe new peer connection state.

◆ sendAnswer()

void WDCConnection::sendAnswer ( webrtc::SessionDescriptionInterface *  description)

Sends an answer to the remote client via the signaling channel.

Parameters
descriptionThe answer.

◆ sendDataMessage()

bool WDCConnection::sendDataMessage ( const webrtc::DataBuffer &  buffer)

Sends a message on the WebRTC data channel.

Parameters
bufferThe message to send.
Returns
true if the message was sent, otherwise false.

◆ sendIceCandidate()

void WDCConnection::sendIceCandidate ( const webrtc::IceCandidateInterface *  candidate)

Sends an ICE candidate to the remote client via the signaling channel.

Parameters
candidateThe ICE candidate.

◆ setLocalDescription()

void WDCConnection::setLocalDescription ( webrtc::SessionDescriptionInterface *  description)

Sets the local session description on the WebRTC data channel being connected.

Parameters
descriptionThe local session description.

◆ setRemoteDescription()

void WDCConnection::setRemoteDescription ( QJsonObject &  description)

Sets the remote session description received from the remote client via the signaling channel.

Parameters
descriptionThe remote session description.

The documentation for this class was generated from the following files: