Example #1
0
 public override void Teardown()
 {
     try
     {
         if (_connection2 != null)
         {
             AsyncContext.Run(() => _connection2.Disconnect());
         }
         if (_connection != null)
         {
             AsyncContext.Run(() => _connection.Disconnect());
         }
     }
     finally
     {
         if (_fayeServerProcess.Started)
         {
             _fayeServerProcess.GracefulShutdown();
         }
         if (_socatInterceptor != null && !_socatInterceptor.HasExited)
         {
             _socatInterceptor.Kill();
         }
         if (File.Exists(ReconnectFilePath))
         {
             File.Delete(ReconnectFilePath);
         }
     }
     base.Teardown();
 }
Example #2
0
 public override void Teardown()
 {
     if (_websocketProcess.Started)
     {
         _websocketProcess.GracefulShutdown();
     }
     base.Teardown();
 }
Example #3
0
 public override void Teardown()
 {
     if (_connection != null)
     {
         AsyncContext.Run(() => _connection.Disconnect());
     }
     if (_fayeServerProcess.Started)
     {
         _fayeServerProcess.GracefulShutdown();
     }
     base.Teardown();
 }
Example #4
0
        public void Shutdown()
        {
            // arrange
            var thin = new ThinServerProcess(thinPort: 1224,
                                             workingDirectory: ".");

            _tcpListener = new TcpListener(IPAddress.Any,
                                           1224);
            _tcpListener.Start();

            // act
            thin.StartThinServer();
            thin.GracefulShutdown();

            // assert
            // because of the quick exit, our shutdown file should already be gone
            var exists = File.Exists(thin.ShutdownTriggerPath);

            exists
            .Should()
            .BeFalse();
        }