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));
        }
 public void Ping()
 {
     try {
         Latency = _clientInformationDecorator.Ping();
     }
     catch (Exception) {
         RemoteClient.Close();
     }
 }
        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);
            }
        }
 private void PingProcess()
 {
     try {
         while (_continuePinging)
         {
             Ping = _clientInformationDecorator.Ping();
             Thread.Sleep(5000);
         }
     }
     catch (RemoteClientException) {
         _remoteClient.Close();
     }
 }