File transfer failure (Could not establish socket with any provided host)

Hello,

I’'m having problems with file transfers. The problem occurs in the following scenario:

  • User1 sends User2 some file. This usually works.

  • User2 now sends User1 some file. This randomly fails with the following exception:

Could not establish socket with any provided host: (406)

at org.jivesoftware.smackx.filetransfer.Socks5TransferNegotiator.selectHost(Socks5 TransferNegotiator.java:200)

at org.jivesoftware.smackx.filetransfer.Socks5TransferNegotiator.negotiateIncoming Stream(Socks5TransferNegotiator.java:117)

at org.jivesoftware.smackx.filetransfer.FaultTolerantNegotiator.createIncomingStre am(FaultTolerantNegotiator.java:82)

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer.negotiateStream(Incom ingFileTransfer.java:177)

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer.recieveFile(IncomingF ileTransfer.java:74)

at de.fu_berlin.inf.dpp.net.internal.XMPPChatTransmitter.receiveFileList(XMPPChatT ransmitter.java:485)

at de.fu_berlin.inf.dpp.net.internal.XMPPChatTransmitter.fileTransferRequest(XMPPC hatTransmitter.java:329)

at org.jivesoftware.smackx.filetransfer.FileTransferManager.fireNewRequest(FileTra nsferManager.java:105)

at org.jivesoftware.smackx.filetransfer.FileTransferManager$1.processPacket(FileTr ansferManager.java:91)

at org.jivesoftware.smack.PacketReader$ListenerWrapper.notifyListener(PacketReader .java:822)

at org.jivesoftware.smack.PacketReader.processListeners(PacketReader.java:260)

at org.jivesoftware.smack.PacketReader.access$100(PacketReader.java:43)

at org.jivesoftware.smack.PacketReader$2.run(PacketReader.java:72)

I am not able to completly reproduce the exception, but it occurs about every second try and always after the first file transfer finished succesfully.

Does anybody have any clue what might be causing this? Any pointers would be very appreciated.

Thanks a lot,

Riad Djemili

Hi,

Is the transfer really failling ? This exception means that the Sock5 connection (direct connection between users) has failed, but Smack should switch to Inband File Transfer after that (and this should work).

Is there any NAT gateway between your 2 users ? are they on the same local network ?

are they using firewalls ?

Nicolas

Hi Nicolas,

I think the transfer is really failing, but I’'ll look into it and check back here.

About NAT: This occurs while running two instances of test programs on my desktop.

Hi,

File transfers create a proxy server on your computer always using the same listening port (7777).

I think that on your second try, the port is still locked by the first user. So the proxy server can’'t start.

Try to use different computers for each user or patch your smack version with my file transfer patch that let you specify the port you want to use.

See this thread :

http://www.jivesoftware.org/community/thread.jspa?messageID=120456&#120456

Nicolas

Message was edited by: nricheton

Hi,

that might be it. Weird that it sometimes works and other times not, though. I’‘ll try your patch. Thanks a lot so far. I’'ll keep you posted.

Hi,

sorry for not replying earlier. I was out of town.

Anyhow… I just tried your patch and it works like a charm. Thanks a lot!

That problem was driving me mad for about two months now.

Cheers,

Riad