protected void OnClientTimeOut(TcpSocket client) { ClientTimeout?.Invoke(this, new TcpSocketEventArgs { Client = client }); client.Dispose(); }
public TcpSocket NewClient(IPEndPoint local, IPEndPoint address) { var client = new TcpSocket { Server = this }; client.Socket = new Socket(address.AddressFamily, SocketType.Stream, ProtocolType.Tcp); if (local != null) { client.Socket.Bind(local); } client.Connect(address); return(client); }
public void Remove(TcpSocket client) { client.Dispose(); }