Skip to content

Commit

Permalink
Merge pull request #978 from ChristopheI/master
Browse files Browse the repository at this point in the history
Fix Data Channel Open Message: Protocol was missing and ChannelType was hardcoded
  • Loading branch information
ChristopheI authored Aug 11, 2023
2 parents 6e3a3b7 + 0fff9a8 commit 2e28a63
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/net/WebRTC/RTCDataChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,26 @@ public void send(byte[] data)
/// </summary>
internal void SendDcepOpen()
{
byte type = (byte)DataChannelTypes.DATA_CHANNEL_RELIABLE;
if (!ordered)
{
type += (byte)DataChannelTypes.DATA_CHANNEL_RELIABLE_UNORDERED;
}
if (maxPacketLifeTime > 0)
{
type += (byte)DataChannelTypes.DATA_CHANNEL_PARTIAL_RELIABLE_TIMED;
}
else if(maxRetransmits > 0)
{
type += (byte)DataChannelTypes.DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT;
}

var dcepOpen = new DataChannelOpenMessage()
{
MessageType = (byte)DataChannelMessageTypes.OPEN,
ChannelType = (byte)DataChannelTypes.DATA_CHANNEL_RELIABLE_UNORDERED,
Label = label
ChannelType = (byte)type,
Label = label,
Protocol = protocol,
};

lock (this)
Expand Down

0 comments on commit 2e28a63

Please sign in to comment.