private void OnDisconnected(object sender, ClientEvents.DisconnectedEventArgs ea) { if (_context.Client != sender) { return; } if (ea.IsDropped) { if (this.Dropped != null) { this.Dropped(sender, ea); } return; } }
/// <summary> /// 断开连接时 /// </summary> /// <param name="sender"></param> /// <param name="ea"></param> private void OnDisconnected(object sender, ClientEvents.DisconnectedEventArgs ea) { if (sender != this.Client) { return; } UnhookRtpEvents(); DisposeUnicastChannel(); DisposeChannels(); if (_disposed) { UnhookFixedEvents(); } if (this.Inactive != null) { this.Inactive(this, EventArgs.Empty); } }
private static void OnDisconnected(object sender, ClientEvents.DisconnectedEventArgs ea) { Clear();//如果断线,需要重置数据 }