public void StopTCPHandler()
 {
     if (tcpHandler == null)
     {
         return;
     }
     tcpHandler.Close();
     TCPDisConnect?.Invoke(this, new EventArgs());
 }
Exemplo n.º 2
0
        public void close_should_ignore_closed_handler()
        {
            var socketMock = new Mock <SocketProxy>(MockBehavior.Loose, (Socket)null);
            var config     = CreateMockConfiguration();
            var relay      = new TCPRelay(null, null);
            var sut        = new TCPHandler(null, config, relay, socketMock.Object);

            sut.Closed = true;
            sut.Close();

            VerifyHandlerDoNotCloseSocket(socketMock);
        }
Exemplo n.º 3
0
        public void close_should_properly_clean_resources()
        {
            _sut.Close();

            AssertResourcesProperlyCleaned(_sut, _tcpRelay, _socketMock, _remoteMock, _encryptorMock);
        }