I posted this same packet reply timeout issue back on Jan. 23rd, 2015 in a different discussion on pubsub. Please read, smack-4.1.0-beta2: Timeout on publish PayloadItem containing JSON. Only difference was that Smack client was doing pubsub instead of file transfer.
Regarding Flow's question on IQ Providers: It is my understanding that Smack clients needs to specify the correct IQ providers in order for File Transfer to be able to parse the stanza at run-time. Furthermore, one thing I noticed is the File Transfer example included with Smack, https://www.igniterealtime.org/builds/smack/docs/latest/documentation/extensions /filetransfer.html, are missing how-to set up the ProviderManager. Same can be said for the PubSub examples. Using the ProviderManager singleton in 4.1.0-rc1, is the following addIQProvider(..) below the correct IQ Provider for File Transfer? If not, what corrections are needed to ensure successful file transfer? Specifically, for 1.) the OutgoingFileTranser (aka, sender) and 2.) the FileTransferListener, which both connect to the same XMPP server. Likewise, for the ServiceDiscoveryManager, which features does she need for successful file transfer?
ProviderManager.addIQProvider("query", "http://jabber.org/protocol/disco#items", new DiscoverItemsProvider());
ProviderManager.addIQProvider("query", "http://jabber.org/protocol/disco#info", new DiscoverInfoProvider());
ProviderManager.addIQProvider("query", "jabber:iq:privacy", new PrivacyProvider());
ProviderManager.addIQProvider("malformed-action", "http://jabber.org/protocol/commands", new AdHocCommandDataProvider());
ProviderManager.addIQProvider("si", "http://jabber.org/protocol/si", new StreamInitiationProvider());
ProviderManager.addIQProvider(Bytestream.QUERY_ELEMENT, Bytestream.NAMESPACE, new BytestreamsProvider());
ProviderManager.addIQProvider(Bytestream.StreamHost.ELEMENTNAME, Bytestream.NAMESPACE, new BytestreamsProvider());
ProviderManager.addIQProvider(Bytestream.StreamHostUsed.ELEMENTNAME, Bytestream.NAMESPACE, new BytestreamsProvider());
ProviderManager.addIQProvider("open", "http://jabber.org/protocol/ibb", new OpenIQProvider());
ProviderManager.addIQProvider("data", "http://jabber.org/protocol/ibb", new DataPacketProvider.IQProvider());
ProviderManager.addIQProvider("close", "http://jabber.org/protocol/ibb", new CloseIQProvider());
ProviderManager.addExtensionProvider("data", "http://jabber.org/protocol/ibb", new DataPacketProvider.PacketExtensionProvider());
Today
- I increased packet reply timeout to 15 seconds using setPacketReplyTimeout(15000); Still get org.jivesoftware.smack.SmackException$NoResponseException: No response received within packet reply timeout. Timeout was 15000ms (~15s)
- Per request from Flow, for Smack sender, I set SmackConfiguration.DEBUG = true. Below is this OutgoingFileTransfer's packet trace:
OutgoingFileTransfer
Raw Sent Packets
-----------------------------
<stream:stream xmlns='jabber:client' to='test.tester.net' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' from='test-sender@test.tester.net' xml:lang='en'>
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'>=</auth>
<response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>Y2hhcnNldD11dGYtOCx1c2VybmFtZT0iamFjZS 1kaXNjb3Zlcnktc2VuZGVyIixyZWFsbT0idGFsa2ludC5lbmVybm9jLm5ldCIsbm9uY2U9InFqMm9rQW dnNGJiM0dKYUh2dUozM0dla3RLRUkySElOa01nYzYvMEgiLG5jPTAwMDAwMDAxLGNub25jZT0iZ25jNk 1zdyt3aEE2VGQ2eVFsTUtoWmltMGxuNWdoTGhoVFE1VEJHNyIsZGlnZXN0LXVyaT0ieG1wcC90YWxraW 50LmVuZXJub2MubmV0IixtYXhidWY9NjU1MzYscmVzcG9uc2U9ZTU4ZDM2NzQ3ODM3OWQ0OTkyY2NkOD IyZDNlMWNjODgscW9wPWF1dGg=</response>
<stream:stream xmlns='jabber:client' to='talkint.enernoc.net' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' from='test-sender@test.tester.net' id='6e163390' xml:lang='en'>
<iq id='aaCvD-1' type='set'>
<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
<resource>Smack</resource></bind>
</iq>
<iq id='aaCvD-3' type='set'>
<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>
<presence id='aaCvD-5'></presence>
<iq to='test-receiver@test.tester.net/Smack' id='aaCvD-6' type='set'>
<si xmlns='http://jabber.org/protocol/si' id='jsi_6669221175945530172' profile='http://jabber.org/protocol/si/profile/file-transfer'>
<file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="results.json" size="4830965" >
<desc>Discovery file named: results.json</desc>
</file><feature xmlns="http://jabber.org/protocol/feature-neg">
<x xmlns='jabber:x:data' type='form'>
<field var='stream-method' type='list-single'>
<option><value>http://jabber.org/protocol/bytestreams</value></option>
<option><value>http://jabber.org/protocol/ibb</value></option>
</field></x></feature></si>
</iq>
<iq to='test-receiver@test.tester.net/Smack' id='aaCvD-8' type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'></query>
</iq>
<iq to='test-receiver@test.tester.net/Smack' id='aaCvD-9' type='set'>
<open xmlns='http://jabber.org/protocol/ibb' block-size='4096' sid='jsi_6669221175945530172' stanza='iq'/>
</iq>
<iq to='test.tester.net' id='aaCvD-11' type='get'>
<ping xmlns='urn:xmpp:ping'/></iq>
OutgoingFileTransfer
Raw Received Packets
--------------------------------
<?xml version='1.0' encoding='UTF-8'?>
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="test.tester.net" id="6e163390" xml:lang="en" version="1.0">
<stream:features>
<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"></starttls>
<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
<mechanism>DIGEST-MD5</mechanism>
<mechanism>PLAIN</mechanism>
<mechanism>CRAM-MD5</mechanism>
</mechanisms><compression xmlns="http://jabber.org/features/compress">
<method>zlib</method>
</compression>
<auth xmlns="http://jabber.org/features/iq-auth"/>
<register xmlns="http://jabber.org/features/iq-register"/>
</stream:features>
<challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09InRhbGtpbnQuZW5lcm5vYy5uZXQiLG 5vbmNlPSJxajJva0FnZzRiYjNHSmFIdnVKMzNHZWt0S0VJMkhJTmtNZ2M2LzBIIixxb3A9ImF1dGgiLG NoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz</challenge>
<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cnNwYXV0aD1kNTU2MDE1YWI5MDRmMmY0MGVjZm YyNmYxYmRmY2Y3Ng==</success>
<?xml version='1.0' encoding='UTF-8'?>
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="test.tester.net" id="6e163390" xml:lang="en" version="1.0">
<stream:features>
<compression xmlns="http://jabber.org/features/compress">
<method>zlib</method>
</compression><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/>
<session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>
</stream:features>
<iq type="result" id="aaCvD-1" to="test.tester.net/6e163390">
<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
<jid>test-sender@test.tester.net/Smack</jid>
</bind>
</iq>
<iq type="result" id="aaCvD-3" to="test-sender@test.tester.net/Smack">
<session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>
</iq>
<iq to="test-sender@test.tester.net/Smack" id="aaCvD-6" type="result" from="test-receiver@test.tester.net/Smack">
<si xmlns="http://jabber.org/protocol/si">
<feature xmlns="http://jabber.org/protocol/feature-neg">
<x xmlns="jabber:x:data" type="submit"><field var="stream-method">
<value>http://jabber.org/protocol/bytestreams</value>
<value>http://jabber.org/protocol/ibb</value></field></x>
</feature>
</si>
</iq>
<iq to="test-sender@test.tester.net/Smack" id="aaCvD-8" type="result" from="test-receiver@test.tester.net/Smack">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="client" name="Smack" type="pc"/>
<feature var="http://jabber.org/protocol/commands"/>
<feature var="http://jabber.org/protocol/file-transfer"/>
<feature var="http://jabber.org/protocol/xhtml-im"/>
<feature var="jabber:iq:privacy"/>
<feature var="http://jabber.org/protocol/disco#items"/>
<feature var="vcard-temp"/>
<feature var="urn:xmpp:time"/>
<feature var="jabber:iq:last"/>
<feature var="urn:xmpp:ping"/>
<feature var="jabber:x:data"/>
<feature var="http://jabber.org/protocol/bytestreams"/>
<feature var="http://jabber.org/protocol/ibb"/>
<feature var="urn:xmpp:http"/>
<feature var="http://jabber.org/protocol/muc"/>
<feature var="http://jabber.org/protocol/si"/>
<feature var="http://jabber.org/protocol/xdata-validate"/>
<feature var="http://jabber.org/protocol/xdata-layout"/>
<feature var="http://jabber.org/protocol/si/profile/file-transfer"/>
<feature var="urn:xmpp:receipts"/>
<feature var="http://jabber.org/protocol/disco#info"/>
</query>
</iq>
<iq type="result" id="aaCvD-11" from="test.tester.net" to="test-sender@test.tester.net/Smack"/>