public void Stop() { if (!IsRunning) { throw new InvalidOperationException("Already stopped"); } StopAcceptLoop(); _sendRequestProcessingEngine.Stop(); _receiveCompletionProcessor.Stop(); IsRunning = false; }
private void Dispose(bool disposing) { if (disposing) { _session.Close(); _receiveCompletionProcessor.Stop(); _sendRequestProcessingEngine.Stop(); _completionQueues?.Dispose(); _sessionManager?.Dispose(); _sendRequestProcessingEngine?.Dispose(); _handshakeSignal?.Dispose(); } else { if (_socket != IntPtr.Zero) { WinSock.closesocket(_socket); } } }