我的客户端代码看起来像这样......
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();
}
}
调用此代码时,库会挂起以下对Monitor的调用...
while (!this.ReadAvailable(count))
Monitor.Wait(this._buffer);
此代码段来自int Read(byte[] buffer, int offset, int count)
中的PipeStream
。
其他人似乎也有类似的问题here。
但是回复对我来说还没有帮助,我想避免编辑源代码。
有什么想法吗?