我尝试使用Sharp.xmpp作为控制台应用程序的库。当我试图传输文件时,它启动文件传输,接收方可以接受它(另一个客户端使用spark),但是在通过另一个客户端接受它之后,文件传输就被中止了。我只是遵循文档中的示例代码。
client.InitiateFileTransfer(recipient, "path_to_file_to_send", "description of the file", FileTransferCallback);这是回调
static void FileTransferCallback(bool accepted, FileTransfer transfer)
{
Console.WriteLine(transfer.To + " has " + (accepted == true ? "accepted " : "rejected ") + "the transfer of " + transfer.Name + ".");
}发布于 2018-06-27 04:03:07
同样的事情发生在这里..。
我找到了client = listener.AcceptTcpClient(timeout);
在Socks5Server.cs中,我认为这一节造成了问题。
有一个例外是这样的。
Exception : 'System.ArgumentNullException'(System.Core.dll)当TcpListener.AcceptTcpClient()之后运行时会发生这种情况。
如果有人找到了解决方案,请分享。
然后解决了!
Client.FileTransferSettings.UseUPnP = true;
Client.FileTransferSettings.ForceInBandBytestreams = true;将此代码添加到任意位置。
https://stackoverflow.com/questions/51015535
复制相似问题