powered by Jive Software

File transfer negotiation problem

We are using Spark for chat application on lossy and delayed network(round trip time is nearly 15-25 second).
On Spark we can adjust timeout values for opening connections to openfire server. For chat we have no problem but we have problems about file transfer. After file transfer is started we see the below exception on the receiving side;

“SEVERE: There was an error during file transfer.
org.jivesoftware.smack.SmackException:Error in execution
at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer.negotiateStream(IncomingFileTransfer.java:199)
at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer.access$100(IncomingFileTransfer.java:57)
at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer$1.run(IncomingFileTransfer.java:129)
Caused by: java.util.concurrent.ExecutionException: org.jivesoftware.smack.Smack:Exception: SOCK5 negotiation failed
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.report(FutureTask.java:206)
at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer.negotiateStream(IncomingFileTransfer.java:193)”

When I looked at the file IncomingfileTransfer.java line 199 it seems that it is
"throw new SmackException(“Error in execution”, e);" exception.

Firstly I thought that it is a timeout problem because of long round-trip times but there is also a timeout exception available in line 202;
" throw new SmackException(“Request timed out”, e);" and it is not trown.

note that when I kill the sender spark instance during negotiation process the same exception happens.

The source of exception happens in method line 193 ;

"inputStream = streamNegotiatorTask.get(15, TimeUnit.SECONDS);"
It means that after 15 second the neagotiation must finished but this is not the case in our network(may last up to 10 min.).

Also I decreased the round-trip time in the radio network the problem disappears.

As a result alhough from the exception it does not seem a timeout problem, I think it is a timeout problem because of line 193.
I think its timeout value must be the same as file transfer timeout defined in File Transfer Preference->Transfer Timeout in Spark.

Related discussion File transfer failure on delayed network