示例#1
0
        protected override void SetupData()
        {
            base.SetupData();

            _disconnectMessage = new DisconnectMessage(DisconnectReason.ServiceNotAvailable, "Not today!");
            _packet            = _disconnectMessage.GetPacket(8, null);
        }
        protected override void Act()
        {
            var disconnect = _disconnectMessage.GetPacket(8, null);

            ServerSocket.Send(disconnect, 4, disconnect.Length - 4, SocketFlags.None);

            Session.Disconnect();
        }
        protected override void Act()
        {
            var disconnect = _disconnectMessage.GetPacket(8, null);

            ServerSocket.Send(disconnect, 4, disconnect.Length - 4, SocketFlags.None);

            // give session some time to process DisconnectMessage
            Thread.Sleep(200);
        }
        protected override void Act()
        {
            // server sends SSH_MSG_DISCONNECT
            var disconnect = _disconnectMessage.GetPacket(8, null);

            ServerSocket.Send(disconnect, 4, disconnect.Length - 4, SocketFlags.None);

            // server shuts down the socket
            ServerSocket.Shutdown(SocketShutdown.Send);

            // give session some time to process DisconnectMessage and socket shutdown
            Thread.Sleep(200);
        }