private void OnAcceptSocket(IAsyncResult asyncResult) { try { _tcpConnection = null; try { _tcpConnection = new TcpConnection(_tcpListener.EndAcceptTcpClient(asyncResult)); } catch (ObjectDisposedException) { return; } if (_connectionSecurity == eConnectionSecurity.eCSTLS) { _tcpConnection.HandshakeAsServer(_localCertificate); } _numberOfConnectedClients++; HandleClient(); } finally { DisposeSocket(); _clientCompleted.Set(); } }
private void OnAcceptSocket(IAsyncResult asyncResult) { try { _tcpConnection = null; try { _tcpConnection = new TcpConnection(_tcpListener.EndAcceptTcpClient(asyncResult)); } catch (ObjectDisposedException) { return; } if (_connectionSecurity == eConnectionSecurity.eCSTLS) { _tcpConnection.HandshakeAsServer(_localCertificate); } _numberOfConnectedClients++; HandleClient(); } finally { DisposeSocket(); _clientCompleted.Set(); } }