When I connect to Firebase Cloud Messaging using XMPP the connection typically disconnects after approximately 10 minutes. What I find is that I have to keep sending an upstream message to FCM every few minutes to ensure the connection does not disconnect. Is this expected?
Asked
Active
Viewed 558 times
1
-
I think this part of Firebase [documentation](https://firebase.google.com/docs/cloud-messaging/server#implementing-the-xmpp-connection-server-protocol) can help you about the XMPP connection. Also, this [SO question](http://stackoverflow.com/questions/38133756) explains that if you are using XMPP, you need an upstream message. For more information, check this [link](https://developers.google.com/cloud-messaging/upstream). – KENdi Nov 05 '16 at 07:59
-
Not entirely sure, but maybe you're encountering what is mentioned in the [docs](https://firebase.google.com/docs/cloud-messaging/server#implementing-the-xmpp-connection-server-protocol) under **Control Messages**: `Periodically, CCS needs to close down a connection to perform load balancing.` – AL. Nov 05 '16 at 11:28
1 Answers
1
yes, that is the normal behavior according the documentation of the XMPP protocol link to XMPP documentation
When an entity that is a party to a stream has not received any XMPP traffic from its stream peer for some period of time, the peer might appear to be silent. There are several reasons why this might happen:
- The underlying TCP connection is dead.
- The XML stream is broken despite the fact that the underlying TCP connection is alive.
- The peer is idle and simply has not sent any XMPP traffic over its XML stream to the entity.
the traditional approach for solving this issue has been periodically to send so-called "whitespace pings" over the XML stream