Пример #1
0
        public string ExecuteCommand(IRemoteClient remoteClient, IEnumerable <string> parameters)
        {
            var decorator = new ClientInformationDecorator(remoteClient);
            var duration  = decorator.Ping();

            return(string.Format("Ping to client : {0} ms", duration));
        }
Пример #2
0
 public void Ping()
 {
     try {
         Latency = _clientInformationDecorator.Ping();
     }
     catch (Exception) {
         RemoteClient.Close();
     }
 }
Пример #3
0
        protected override void HandleInternal(CommandLine commandLine, IRemoteClient remoteClient)
        {
            var decorator = new ClientInformationDecorator(remoteClient);

            for (var i = 0; i < 5; i++)
            {
                var duration = decorator.Ping();
                WriteInfo(string.Format("Ping to client : {0} ms", duration));
                Thread.Sleep(500);
            }
        }
Пример #4
0
 private void PingProcess()
 {
     try {
         while (_continuePinging)
         {
             Ping = _clientInformationDecorator.Ping();
             Thread.Sleep(5000);
         }
     }
     catch (RemoteClientException) {
         _remoteClient.Close();
     }
 }