Home
WebRTC support helpers

WebSocketSignaller

SignallingInterface implementation using plain JSON over WebSocket.

WebSocketSignaller

#include <icy/webrtc/support/wssignaller.h>
class WebSocketSignaller

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:29

Inherits: SignallingInterface

SignallingInterface implementation using plain JSON over WebSocket.

List of all members

NameKindOwner
SendMessagevariableDeclared here
WebSocketSignallerfunctionDeclared here
~WebSocketSignallerfunctionDeclared here
WebSocketSignallerfunctionDeclared here
operator=functionDeclared here
sendSdpfunctionDeclared here
sendCandidatefunctionDeclared here
sendControlfunctionDeclared here
receivefunctionDeclared here
setLocalPeerIdfunctionDeclared here
localPeerIdfunctionDeclared here
_localPeerIdvariableDeclared here
_mutexvariableDeclared here
sendJsonfunctionDeclared here
SdpReceivedvariableInherited from SignallingInterface
CandidateReceivedvariableInherited from SignallingInterface
ControlReceivedvariableInherited from SignallingInterface
~SignallingInterfacefunctionInherited from SignallingInterface
sendSdpfunctionInherited from SignallingInterface
sendCandidatefunctionInherited from SignallingInterface
sendControlfunctionInherited from SignallingInterface

Inherited from SignallingInterface

KindNameDescription
variableSdpReceivedFires when an SDP offer or answer arrives from a remote peer. Parameters: peerId, type ("offer"/"answer"), sdp.
variableCandidateReceivedFires when an ICE candidate arrives from a remote peer. Parameters: peerId, candidate, mid.
variableControlReceivedFires when a control message arrives from a remote peer. Parameters: peerId, type ("init"/"accept"/"reject"/"hangup"), reason.
function~SignallingInterface virtualDefaulted destructor.
functionsendSdp virtualSend an SDP offer or answer to the remote peer.
functionsendCandidate virtualSend an ICE candidate to the remote peer.
functionsendControl virtualSend a control message to the remote peer.

Public Attributes

ReturnNameDescription
Signal< void(const std::string &)>SendMessage

SendMessage

Signal< void(const std::string &)> SendMessage

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:52

Public Methods

ReturnNameDescription
WebSocketSignaller explicit
WebSocketSignallerDeleted constructor.
voidsendSdp virtual overrideSend an SDP offer or answer to the remote peer.
voidsendCandidate virtual overrideSend an ICE candidate to the remote peer.
voidsendControl virtual overrideSend a control message to the remote peer.
voidreceive
voidsetLocalPeerId inline
const std::string &localPeerId const inline

WebSocketSignaller

explicit

explicit WebSocketSignaller(const std::string & localPeerId = {})

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:32


WebSocketSignaller

WebSocketSignaller(const WebSocketSignaller &) = delete

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:35

Deleted constructor.


sendSdp

virtual override

virtual void sendSdp(const std::string & peerId, const std::string & type, const std::string & sdp) override

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:38

Send an SDP offer or answer to the remote peer.

Parameters

  • peerId Remote peer identifier.

  • type "offer" or "answer".

  • sdp The SDP string.

Reimplements

sendCandidate

virtual override

virtual void sendCandidate(const std::string & peerId, const std::string & candidate, const std::string & mid) override

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:42

Send an ICE candidate to the remote peer.

Parameters

  • peerId Remote peer identifier.

  • candidate The candidate string (from RTCIceCandidate).

  • mid The sdpMid value.

Reimplements

sendControl

virtual override

virtual void sendControl(const std::string & peerId, const std::string & type, const std::string & reason = {}) override

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:46

Send a control message to the remote peer.

Parameters

  • peerId Remote peer identifier.

  • type Control type: "init", "accept", "reject", "hangup".

  • reason Optional reason string (for reject/hangup).

Reimplements

receive

void receive(const std::string & json)

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:50


setLocalPeerId

inline

inline void setLocalPeerId(const std::string & id)

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:54


localPeerId

const inline

inline const std::string & localPeerId() const

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:55

Private Attributes

ReturnNameDescription
std::string_localPeerId
std::mutex_mutex

_localPeerId

std::string _localPeerId

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:60


_mutex

std::mutex _mutex

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:61

Private Methods

ReturnNameDescription
voidsendJson

sendJson

void sendJson(const json::Value & msg)

Defined in src/webrtc/support/include/icy/webrtc/support/wssignaller.h:58