Hi, I am recieving a NoResponseException when making a xmpp connection. I am not expecting a response in the application after I send a message through the connection. Below is where I am using the code to make the connection and the call to the connect method. It seems that I get a response later after 5 min instead of 5s. Is there away around this besides setting the packet reply time out to a greater amount?
Thanks in advance,
James B
androidNotificationHandler.connect(senderId, password);
public void connect(long senderId, String apiKey)
throws XMPPException, IOException, SmackException {
XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()
.setSecurityMode(XMPPTCPConnectionConfiguration.SecurityMode.disabled)
.setPort(AndroidNotificationHandler.GCM_PORT)
.setHost(AndroidNotificationHandler.GCM_SERVER)
.setSocketFactory(SSLSocketFactory.getDefault())
.setServiceName(AndroidNotificationHandler.GCM_SERVER)
.setDebuggerEnabled(true)
.build();
connection = new XMPPTCPConnection(config);
connection.setPacketReplyTimeout(10000L);
connection.removeAllStanzaAcknowledgedListeners();
connection.connect();
connection.login(senderId + "@gcm.googleapis.com", apiKey);
}
11:06:11 PM SENT (0): <stream:stream xmlns=‘jabber:client’ to=‘gcm.googleapis.com’ xmlns:stream=‘http://etherx.jabber.org/streams’ version=‘1.0’ xml:lang=‘en’>
11:06:11 PM RECV (0): <stream:stream from=“gcm.googleapis.com” id=“08EF9F0DE2952851” version=“1.0” xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client”>
11:06:11 PM RECV (0): stream:featuresX-OAUTH2X-GOOGLE-TOKENPLAIN</stream: features>
11:06:11 PM SENT (0): ADgzNjA5MjE1Nzk4OUBnY20uZ29vZ2xlYXBpcy5jb20AQUl6YVN5RGNleXFfM DNLNkhsM0RMN2hrWUdlYW1nM3d2d3JzU09V
11:06:12 PM RECV (0):
11:06:12 PM SENT (0): <stream:stream xmlns=‘jabber:client’ to=‘gcm.googleapis.com’ xmlns:stream=‘http://etherx.jabber.org/streams’ version=‘1.0’ id=‘08EF9F0DE2952851’ xml:lang=‘en’>
11:06:12 PM RECV (0): <stream:stream from=“gcm.googleapis.com” id=“446DF2621F37A2D7” version=“1.0” xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client”>
11:06:12 PM RECV (0): stream:features</stream:features>
11:06:12 PM SENT (0): Smack
11:06:12 PM RECV (0): 836092157989@gcm.googleapis.com/SmackF34A92C9
11:06:12 PM RECV (0):
11:06:12 PM SENT (0):
11:06:12 PM RECV (0):
11:06:12 PM User logged (0): 836092157989@gcm.googleapis.com:5235/SmackF34A92C9
11:06:12 PM XMPPConnection authenticated (0)
11:06:12 PM SENT (0):
11:06:12 PM SENT (0):
2015-04-21 23:06:12,318 DEBUG AndroidNotification com.gamerparentsinc.notification.AndroidNotification - Sending notification, Testing notification for token 123456
11:06:12 PM SENT (0): {“delay_while_idle”:true,“data”:{“EmbeddedMessageId” :“messageId-88596421-f325-400d-92e1-595e4224d6a2”,“message”:“Testing notification”},“time_to_live”:10000,“message_id”:“messageId-88596421-f325-400d- 92e1-595e4224d6a2”,“to”:“123456”}
11:06:12 PM RECV (0): <data:gcm xmlns:data=“google:mobile:data”>{“message_id”:“messageId-88596421-f325-400d-92e 1-595e4224d6a2”,“from”:“123456”,“error_description”:"",“error”:"BAD_REGISTRATION ",“message_type”:“nack”}</data:gcm>
Apr 21, 2015 11:06:22 PM org.jivesoftware.smack.roster.Roster$3 processException
SEVERE: Exception reloading roster
org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 10000ms (~10s). Used filter: IQReplyFilter: iqAndIdFilter (AndFilter: (OrFilter: (IQTypeFilter: type=error, IQTypeFilter: type=result), StanzaIdFilter: id=PPgTi-8)), : fromFilter (OrFilter: (FromMatchesFilter (full): null, FromMatchesFilter (bare): 836092157989@gcm.googleapis.com, FromMatchesFilter (full): gcm.googleapis.com)).
at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackExceptio n.java:106)
at org.jivesoftware.smack.AbstractXMPPConnection$6.run(AbstractXMPPConnection.java :1438)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201 (ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Schedu ledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)