private void esfTcpListener_TcpConnectionEstablished(System.Net.Sockets.NetworkStream stream) { ISafeNetworkStream safeStream = new SafeNetworkStream(stream); ContextKey key = new ContextKey(safeStream, this.recieveBuffSize); this.contextKeyManager.InsertContextKey(key); int connectID = key.NetStream.GetHashCode(); if (this.SomeOneConnected != null) { this.SomeOneConnected(connectID); } }
private void esfTcpListener_TcpConnectionEstablished(System.Net.Sockets.NetworkStream stream) { ISafeNetworkStream safeStream = new SafeNetworkStream(stream); ContextKey key = new ContextKey(safeStream, this.recieveBuffSize); this.contextKeyManager.InsertContextKey(key); int connectID = key.NetStream.GetHashCode(); if (this.SomeOneConnected != null) { this.SomeOneConnected(connectID); } key.NetStream.NetworkStream.BeginRead(key.Buffer, 0, this.contractHelper.MessageHeaderLength, new AsyncCallback(this.ServeOverLap), key); }