Reputation: 319
I have a simple app server written in Erlang that uses XMPP to send downstream messages. Client apps are expected to be Android devices. My Erlang module implements gen_server
behavior; on init
it connects to GCM Connection Server (CCS) using XMPP,
and it has one exported function to send downstream messages.
The problem is SSL socket gets closed when I try to send a message. If I don't send any messages the socket is being closed in 20 seconds.
Authentication is successfully done, I do receive <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
response. Upon sending a message there is no ACK messages, the socket closes immediately.
The code is available here. It is an Erlang project using rebar3
.
What do I missing here? Why is my socket connection gets closed?
Upvotes: 0
Views: 201
Reputation: 319
The problem is resolved by sending additional stanzas after authentication. Check out the code whose link is mentioned above in the question to see what stanzas shall be interchanged in order to be able to send notifications.
GCM CCS docs lack this info and thus the problem arose.
Upvotes: 1