private void ClientAcceptedCallBack(IAsyncResult Res) { try { TcpClient client = listener.EndAcceptTcpClient(Res); listener.BeginAcceptTcpClient(new AsyncCallback(this.ClientAcceptedCallBack), null); CryptoNetClient netClient = new CryptoNetClient(client); OnClientConnected(netClient); } catch(ObjectDisposedException) { } }
protected void OnClientConnected(CryptoNetClient client) { if(this.ClientConnected != null) this.ClientConnected(client); }