Class SctpDataChunk
Inherited Members
Namespace: SIPSorcery.Net
Assembly: SIPSorcery.dll
Syntax
public class SctpDataChunk : SctpChunk
Constructors
| Improve this Doc View SourceSctpDataChunk(Boolean, Boolean, Boolean, UInt32, UInt16, UInt16, UInt32, Byte[])
Creates a new DATA chunk.
Declaration
public SctpDataChunk(bool isUnordered, bool isBegining, bool isEnd, uint tsn, ushort streamID, ushort seqnum, uint ppid, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isUnordered | Must be set to true if the application wants to send this data chunk without requiring it to be delivered to the remote part in order. |
System.Boolean | isBegining | Must be set to true for the first chunk in a user data payload. |
System.Boolean | isEnd | Must be set to true for the last chunk in a user data payload. Note that
|
System.UInt32 | tsn | The Transmission Sequence Number for this chunk. |
System.UInt16 | streamID | Optional. The stream ID for this data chunk. |
System.UInt16 | seqnum | Optional. The stream sequence number for this send. Set to 0 for unordered streams. |
System.UInt32 | ppid | Optional. The payload protocol ID for this data chunk. |
System.Byte[] | data | The data to send. |
Fields
| Improve this Doc View SourceEmptyDataChunk
An empty data chunk. The main use is to indicate a DATA chunk has already been delivered to the Upper Layer Protocol (ULP) in SctpDataReceiver.
Declaration
public static SctpDataChunk EmptyDataChunk
Field Value
Type | Description |
---|---|
SctpDataChunk |
FIXED_PARAMETERS_LENGTH
The length in bytes of the fixed parameters used by the DATA chunk.
Declaration
public const int FIXED_PARAMETERS_LENGTH = 12
Field Value
Type | Description |
---|---|
System.Int32 |
PPID
Payload Protocol Identifier (PPID). This value represents an application (or upper layer) specified protocol identifier.This value is passed to SCTP by its upper layer and sent to its peer.
Declaration
public uint PPID
Field Value
Type | Description |
---|---|
System.UInt32 |
StreamID
Identifies the stream to which the following user data belongs.
Declaration
public ushort StreamID
Field Value
Type | Description |
---|---|
System.UInt16 |
StreamSeqNum
This value represents the Stream Sequence Number of the following user data within the stream using the StreamID.
Declaration
public ushort StreamSeqNum
Field Value
Type | Description |
---|---|
System.UInt16 |
TSN
This value represents the Transmission Sequence Number (TSN) for this DATA chunk.
Declaration
public uint TSN
Field Value
Type | Description |
---|---|
System.UInt32 |
UserData
This is the payload user data.
Declaration
public byte[] UserData
Field Value
Type | Description |
---|---|
System.Byte[] |
Properties
| Improve this Doc View SourceBegining
The (B)eginning fragment bit, if set, indicates the first fragment of a user message.
Declaration
public bool Begining { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Ending
The (E)nding fragment bit, if set, indicates the last fragment of a user message.
Declaration
public bool Ending { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Unordered
The (U)nordered bit, if set to true, indicates that this is an unordered DATA chunk.
Declaration
public bool Unordered { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceGetChunkLength(Boolean)
Calculates the length for DATA chunk.
Declaration
public override ushort GetChunkLength(bool padded)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | padded | If true the length field will be padded to a 4 byte boundary. |
Returns
Type | Description |
---|---|
System.UInt16 | The length of the chunk. |
Overrides
| Improve this Doc View SourceIsEmpty()
Declaration
public bool IsEmpty()
Returns
Type | Description |
---|---|
System.Boolean |
ParseChunk(Byte[], Int32)
Parses the DATA chunk fields
Declaration
public static SctpDataChunk ParseChunk(byte[] buffer, int posn)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | The buffer holding the serialised chunk. |
System.Int32 | posn | The position to start parsing at. |
Returns
Type | Description |
---|---|
SctpDataChunk |
WriteTo(Byte[], Int32)
Serialises a DATA chunk to a pre-allocated buffer.
Declaration
public override ushort WriteTo(byte[] buffer, int posn)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | The buffer to write the serialised chunk bytes to. It must have the required space already allocated. |
System.Int32 | posn | The position in the buffer to write to. |
Returns
Type | Description |
---|---|
System.UInt16 | The number of bytes, including padding, written to the buffer. |