Class RTCSctpTransport
Represents an SCTP transport that uses a DTLS transport.
Inherited Members
Namespace: SIPSorcery.Net
Assembly: SIPSorcery.dll
Syntax
public class RTCSctpTransport : SctpTransport
Remarks
DTLS encapsulation of SCTP: https://tools.ietf.org/html/rfc8261
WebRTC API RTCSctpTransport Interface definition: https://www.w3.org/TR/webrtc/#webidl-1410933428
Constructors
| Improve this Doc View SourceRTCSctpTransport(UInt16, UInt16, Int32)
Creates a new SCTP transport that runs on top of an established DTLS connection.
Declaration
public RTCSctpTransport(ushort sourcePort, ushort destinationPort, int dtlsPort)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | sourcePort | The SCTP source port. |
System.UInt16 | destinationPort | The SCTP destination port. |
System.Int32 | dtlsPort | Optional. The local UDP port being used for the DTLS connection. This will be set on the SCTP association to aid in diagnostics. |
Fields
| Improve this Doc View SourcemaxChannels
The maximum number of data channel's that can be used simultaneously (where each data channel is a stream on the same SCTP association).
Declaration
public readonly ushort maxChannels
Field Value
Type | Description |
---|---|
System.UInt16 |
Properties
| Improve this Doc View SourceIsDtlsClient
Indicates the role of this peer in the DTLS connection. This influences the selection of stream ID's for SCTP messages.
Declaration
public bool IsDtlsClient { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsPortAgnostic
The SCTP ports are redundant for a DTLS transport. There will only ever be one SCTP association so the SCTP ports do not need to be used for end point matching.
Declaration
public override bool IsPortAgnostic { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourcemaxMessageSize
The maximum size of data that can be passed to RTCDataChannel's send() method.
Declaration
public uint maxMessageSize { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Remarks
| Improve this Doc View SourceRTCSctpAssociation
Declaration
public RTCPeerSctpAssociation RTCSctpAssociation { get; }
Property Value
Type | Description |
---|---|
RTCPeerSctpAssociation |
state
The current state of the SCTP transport.
Declaration
public RTCSctpTransportState state { get; }
Property Value
Type | Description |
---|---|
RTCSctpTransportState |
transport
The transport over which all SCTP packets for data channels will be sent and received.
Declaration
public DatagramTransport transport { get; }
Property Value
Type | Description |
---|---|
Org.BouncyCastle.Crypto.Tls.DatagramTransport |
Methods
| Improve this Doc View SourceAssociate()
Attempts to create and initialise a new SCTP association with the remote party.
Declaration
public void Associate()
Close()
Closes the SCTP association and stops the receive thread.
Declaration
public void Close()
GetInitAckCookie(UInt16, UInt16, UInt32, UInt32, UInt32, String, Int32)
Gets a cookie to send in an INIT ACK chunk. This SCTP transport for a WebRTC peer connection needs to use the same local tag and TSN in every chunk as only a single association is ever maintained.
Declaration
protected override SctpTransportCookie GetInitAckCookie(ushort sourcePort, ushort destinationPort, uint remoteTag, uint remoteTSN, uint remoteARwnd, string remoteEndPoint, int lifeTimeExtension = 0)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | sourcePort | |
System.UInt16 | destinationPort | |
System.UInt32 | remoteTag | |
System.UInt32 | remoteTSN | |
System.UInt32 | remoteARwnd | |
System.String | remoteEndPoint | |
System.Int32 | lifeTimeExtension |
Returns
Type | Description |
---|---|
SctpTransportCookie |
Overrides
| Improve this Doc View SourceSend(String, Byte[], Int32, Int32)
This method is called by the SCTP association when it wants to send an SCTP packet to the remote party.
Declaration
public override void Send(string associationID, byte[] buffer, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System.String | associationID | Not used for the DTLS transport. |
System.Byte[] | buffer | The buffer containing the data to send. |
System.Int32 | offset | The position in the buffer to send from. |
System.Int32 | length | The number of bytes to send. |
Overrides
| Improve this Doc View SourceStart(DatagramTransport, Boolean)
Starts the SCTP transport receive thread.
Declaration
public void Start(DatagramTransport dtlsTransport, bool isDtlsClient)
Parameters
Type | Name | Description |
---|---|---|
Org.BouncyCastle.Crypto.Tls.DatagramTransport | dtlsTransport | |
System.Boolean | isDtlsClient |
UpdateDestinationPort(UInt16)
Attempts to update the SCTP destination port the association managed by this transport will use.
Declaration
public void UpdateDestinationPort(ushort port)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | port | The updated destination port. |
UpdateSourcePort(UInt16)
Attempts to update the SCTP source port the association managed by this transport will use.
Declaration
public void UpdateSourcePort(ushort port)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | port | The updated source port. |
Events
| Improve this Doc View SourceOnStateChanged
Event for notifications about changes to the SCTP transport state.
Declaration
public event Action<RTCSctpTransportState> OnStateChanged
Event Type
Type | Description |
---|---|
System.Action<RTCSctpTransportState> |