protected virtual void OnMissingPackets(MissingPacketEventArgs e) { if (MissingPackets != null) { MissingPackets(this, e); } }
/// <summary> /// Request resend of packets /// </summary> /// <param name="first"></param> /// <param name="last"></param> void requestResend(object sender, MissingPacketEventArgs e) { if (e.Last < e.First) { return; } int len = e.Last - e.First; byte[] request = new byte[] { (byte)0x80, (byte)(0x55 | 0x80), 0x01, 0x00, (byte)((e.First & 0xFF00) >> 8), (byte)(e.First & 0xFF), (byte)((len & 0xFF00) >> 8), (byte)(len & 0xFF) }; lock (socketLock) { if (audioSocket != null) { try { audioSocket.Send(request, request.Length, clientAddress.ToString(), audioSession.ControlPort); } catch (SocketException) { } } } }