Example #1
0
        private void Dispose(bool disposing)
        {
            ReleaseUnmanagedResources();

            if (disposing)
            {
                Stop();

                _completionQueues?.Dispose();
                _sendRequestProcessingEngine?.Dispose();
                _sessionManager?.Dispose();
            }
        }
Example #2
0
        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);
                }
            }
        }