I tried using Sharp.xmpp as a library for my console application. When I tried to transfer file, it initiates the file transfer and the receiver can accept it (another client using spark), but right after accepting it through the other client, the file transfer gets aborted. I just followed the sample code in documentation.
client.InitiateFileTransfer(recipient, "path_to_file_to_send", "description of the file", FileTransferCallback);
and here is the callback
static void FileTransferCallback(bool accepted, FileTransfer transfer)
{
Console.WriteLine(transfer.To + " has " + (accepted == true ? "accepted " : "rejected ") + "the transfer of " + transfer.Name + ".");
}
same thing happens on here..
I found
client = listener.AcceptTcpClient(timeout);
in Socks5Server.cs
and I think this section causes the problem.
There's an exception which is like this.
Exception : 'System.ArgumentNullException'(System.Core.dll)
it occurs when TcpListener.AcceptTcpClient()
run after.
if someone found the solution, please share it.
and Solved!
Client.FileTransferSettings.UseUPnP = true;
Client.FileTransferSettings.ForceInBandBytestreams = true;
add this code to anywhere.