Class Signaler
Base class for WebRTC signaling implementations in Unity.
Namespace: Microsoft.MixedReality.WebRTC.Unity
Assembly: cs.temp.dll.dll
Syntax
public abstract class Signaler : MonoBehaviour
Fields
_nativePeer
Native PeerConnection object from the underlying WebRTC C# library, available once the peer has been initialized and the signaler is attached to it.
Declaration
protected PeerConnection _nativePeer
Field Value
Type | Description |
---|---|
PeerConnection |
Properties
PeerConnection
The PeerConnection this signaler is attached to, or null
if not attached yet to any connection. This is updated automatically by the peer
connection once it finished initializing.
Declaration
public PeerConnection PeerConnection { get; }
Property Value
Type | Description |
---|---|
PeerConnection |
Methods
OnIceCandiateReadyToSend(String, Int32, String)
Callback fired when an ICE candidate message has been generated and is ready to be sent to the remote peer by the signaling object.
Declaration
protected abstract void OnIceCandiateReadyToSend(string candidate, int sdpMlineIndex, string sdpMid)
Parameters
Type | Name | Description |
---|---|---|
String | candidate | |
Int32 | sdpMlineIndex | |
String | sdpMid |
OnPeerInitialized(PeerConnection)
Callback fired from the PeerConnection when it finished initializing, to subscribe to signaling-related events.
Declaration
public void OnPeerInitialized(PeerConnection peer)
Parameters
Type | Name | Description |
---|---|---|
PeerConnection | peer | The peer connection to attach to |
OnPeerUninitializing(PeerConnection)
Callback fired from the PeerConnection before it starts uninitializing itself and disposing of the underlying implementation object.
Declaration
public void OnPeerUninitializing(PeerConnection peer)
Parameters
Type | Name | Description |
---|---|---|
PeerConnection | peer | The peer connection about to be deinitialized |
OnSdpAnswerReadyToSend(String)
Callback fired when a local SDP answer has been generated and is ready to be sent to the remote peer by the signaling object.
Declaration
protected abstract void OnSdpAnswerReadyToSend(string answer)
Parameters
Type | Name | Description |
---|---|---|
String | answer | The SDP answer message to send. |
OnSdpOfferReadyToSend(String)
Callback fired when a local SDP offer has been generated and is ready to be sent to the remote peer by the signaling object.
Declaration
protected abstract void OnSdpOfferReadyToSend(string offer)
Parameters
Type | Name | Description |
---|---|---|
String | offer | The SDP offer message to send. |
SendMessageAsync(Signaler.Message)
Asynchronously send a signaling message to the remote peer.
Declaration
public abstract Task SendMessageAsync(Signaler.Message message)
Parameters
Type | Name | Description |
---|---|---|
Signaler.Message | message | The signaling message to send to the remote peer. |
Returns
Type | Description |
---|---|
Task | A Task object completed once the message has been sent, but not necessarily delivered. |
Update()
Declaration
protected virtual void Update()
Events
OnConnect
Declaration
public event Action OnConnect
Event Type
Type | Description |
---|---|
Action |
OnDisconnect
Declaration
public event Action OnDisconnect
Event Type
Type | Description |
---|---|
Action |
OnFailure
Declaration
public event Action<Exception> OnFailure
Event Type
Type | Description |
---|---|
Action<Exception> |
OnMessage
Declaration
public event Action<Signaler.Message> OnMessage
Event Type
Type | Description |
---|---|
Action<Signaler.Message> |