public void Send(RtpPacket packet) { try { foreach (var item in this.pc) { RtpParticipant current = item; if (current.Active) { IPEndPoint rTPEndpoint = current.RTPEndpoint; byte[] array = current.PrepareSendRTP(packet); if (array != null) { this.client.Send(array, rTPEndpoint); short num = current.SequenceNumber; num += 1; current.SequenceNumber = num; uint num2 = current.PacketCount; num2 += 1u; current.PacketCount = num2; current.OctetCount += packet.DataSize; } } } } catch { throw; } }
public bool RemoveParticipant(RtpParticipant participant) { lock (_objLock) { int c = this.pc.RemoveAll(t => t.SSRC == participant.SSRC); return(c > 0 ? true : false); } }
public void AddParticipant(RtpParticipant participant) { lock (_objLock) { try { participant.OnRTCPTimer = new RtpParticipant.RTCPTimerCallBack(this.OnRTCPTimerCallBack); this.pc.Add(participant); } catch { } } }
public virtual void AddParticipant(RtpParticipant participant) { lock (_objLock) { try { Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); socket.Bind(participant.RTPEndpoint); ParticipantContainer participantContainer = new ParticipantContainer(participant, socket); this.participants.Add(participantContainer); this.CreateSocketArrays(); if (participant.IsRTCPActive) { Socket socket2 = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); socket2.Bind(participant.RTCPEndpoint); participantContainer.RtcpSocket = socket2; } } catch { } } }
public bool OnRTCPTimerCallBack(RtpParticipant participant) { return(true); }
public ParticipantContainer() { this.rtpSocket = null; this.rtcpSocket = null; this.participant = null; }
public ParticipantContainer(RtpParticipant p, Socket socket) { this.rtcpSocket = null; this.rtpSocket = socket; this.participant = p; }