Hangs on file upload

1.1k Views Asked by At

My client code looks like this...

public void Upload(string localFile, string remoteFile)
{
                ConnectionInfo connectionInfo =
                    new PasswordConnectionInfo(hostIP, username, password);

                using (ScpClient scpClient = new ScpClient(connectionInfo))
                {
                    scpClient.Connect();

                    FileInfo localFileInfo = new FileInfo(localFile);

                    scpClient.Upload(localFileInfo, remoteFile);

                    scpClient.Disconnect();
                }
}

When calling this code the library hangs on the call to Monitor in the following...

        while (!this.ReadAvailable(count))
            Monitor.Wait(this._buffer);

This snippet is from int Read(byte[] buffer, int offset, int count) in PipeStream.

Others seemed to have had similar issues here.

But the responses haven't helped me as yet and I'd like to avoid editing the source code.

Any ideas?

0

There are 0 best solutions below