コード例 #1
0
 /// <summary>
 /// Event handler for packets received on the RTP UDP socket.
 /// </summary>
 /// <param name="receiver">The UDP receiver the packet was received on.</param>
 /// <param name="localPort">The local port it was received on.</param>
 /// <param name="remoteEndPoint">The remote end point of the sender.</param>
 /// <param name="packet">The raw packet received (note this may not be RTP if other protocols are being multiplexed).</param>
 protected virtual void OnRTPPacketReceived(UdpReceiver receiver, int localPort, IPEndPoint remoteEndPoint, byte[] packet)
 {
     if (packet?.Length > 0)
     {
         LastRtpDestination = remoteEndPoint;
         OnRTPDataReceived?.Invoke(localPort, remoteEndPoint, packet);
     }
 }
コード例 #2
0
 /// <summary>
 /// Event handler for packets received on the RTP UDP socket.
 /// </summary>
 /// <param name="receiver">The UDP receiver the packet was received on.</param>
 /// <param name="localEndPoint">The local end point it was received on.</param>
 /// <param name="remoteEndPoint">The remote end point of the sender.</param>
 /// <param name="packet">The raw packet received (note this may not be RTP if other protocols are being multiplexed).</param>
 private void OnRTPPacketRecived(UdpReceiver receiver, IPEndPoint localEndPoint, IPEndPoint remoteEndPoint, byte[] packet)
 {
     if (packet?.Length > 0)
     {
         LastRtpDestination = remoteEndPoint;
         OnRTPDataReceived?.Invoke(localEndPoint, remoteEndPoint, packet);
     }
 }