/// <summary> /// Stops the connection /// </summary> public void Stop(bool RaiseEvent) { stopped = true; try { client.Close(); } catch { } try { ConnectionClosedArgs cca = new ConnectionClosedArgs(); ConnectionClosed(this, cca); } catch { } }
private static void OnConnectionClosed(ConnectionClosedArgs obj) { Console.WriteLine("Connection closed!"); }
/// <summary> /// Disconects the given client /// </summary> /// <param name="cl">Client</param> public void StopClient(ConnectedClient cl) { try { cl.client.Close(); } catch { } try { ConnectionClosedArgs cca = new ConnectionClosedArgs(cl); ConnectionClosed(this, cca); } catch { } }