Problem to receive SshCommand.Execute() response

Jun 2, 2014 at 1:07 PM
Hi, I call SshCommand.Execute() method a lot of times to copy files on a linux system. I am communicating with 3-5 hosts at the same time and sometimes SshCommand.Execute() hangs for some of the threads. When one thread is finished the Execute method response is received for one of the other threads.
      public void RunCmd(string ip, string user, string password, string command)
        {
            using (Renci.SshNet.SshClient client = new Renci.SshNet.SshClient(ip, user, password))
            {
                client.Connect();
                if (client.IsConnected)
                {
                    SshCommand cmd = client.CreateCommand(command);
                    result = cmd.Execute(command);
                }
            }
        }