GCM XMPP delivery receipt send other machine and GCM closes connection when receive its ack

北城以北 提交于 2019-12-11 12:52:16

问题


I have an application running on two machines, each of them are have established a connection through GCM via TCP(XMPP).

One issue i'm experiencing is that sending an xmpp message through one connection with the 'delivery_receipt_requested' flag, does not necessarily means receiving the receipt for that message on the same connection. This is obviously very problematic, since connections might be set up on different processes, sometimes on different machines.

An other issue is that machine received delivery_receipt (which does not send original message) tries to send a delivery receipt ack to the GCM, GCM closes this connection.

Does it seem to be weird? GCM send delivery receipt an other machines and when it receives the delivery receipt ack from that machine it closes the connection since message does not send from that machine?


回答1:


I have found the reason why connection is closed. I had many connection and my application sent deliverty_receipt_ack to the GCM over any connection in connection pool. And after some period of time google sent XMPP error with "received more ack than expected" then connection was closed.

This communication model causes the connection-closed problem, correct way is to use the connection received deliverty_receipt in order to send delivery_receipt_ack, in other word using same connection to send delivery_receipt_ack in reponse to delivery_receipt solves the problem.




回答2:


is it a must to send an ack for delivery receipt? i haven't any issues so far without sending it, well except for the huge delay when the phones have lousy connections, e.g. from a foreign country.



来源:https://stackoverflow.com/questions/32416971/gcm-xmpp-delivery-receipt-send-other-machine-and-gcm-closes-connection-when-rece

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!