/// <summary> /// Event handler for a new data channel being created by the remote peer. /// </summary> /// <param name="s">The SCTP stream that was created.</param> /// <param name="label">The label for the stream. Can be empty and can also be a duplicate.</param> /// <param name="payloadProtocolID">The payload protocol ID of the new stream.</param> public void onDCEPStream(SCTPStream s, string label, int payloadProtocolID) { logger.LogDebug($"SCTP data channel stream opened for label {label}, ppid {payloadProtocolID}, stream id {s.getNum()}."); bool isLocalStreamID = (_isClient) ? s.getNum() % 2 == 0 : s.getNum() % 2 != 0; OnSCTPStreamOpen?.Invoke(s, isLocalStreamID); }
internal void OnStreamOpened() { logger.LogDebug($"Data channel for label {label} now open."); IsOpened = true; id = (ushort)_sctpStream.getNum(); readyState = RTCDataChannelState.open; onopen?.Invoke(); }
public void close(SCTPStream s) { IsOpened = false; logger.LogDebug($"Data channel stream closed id {s.getNum()}."); onclose?.Invoke(); }