/// <summary> /// Called when the TCP socket has disconnected from the server. /// </summary> /// <param name="Sender">The sender.</param> /// <param name="EventArgs">The <see cref="TcpSocketDisconnectedEventArgs"/> instance containing the event data.</param> private static void OnSocketDisconnected(object Sender, TcpSocketDisconnectedEventArgs EventArgs) { var EndPoint = EventArgs.EndPoint is IPEndPoint Ip?Ip.ToString() : EventArgs.EndPoint is DnsEndPoint Dns?Dns.ToString() : "(NULL)"; Trace.WriteLine($"[*] We've disconnected {EndPoint} from the server!"); }