Android - Sockets vs Polling

前端 未结 3 406
暗喜
暗喜 2021-01-13 04:29

As part of an Android app I\'m developing there is a chat room feature. We have a server which can process the incoming messages and store the messages. Is it better to keep

3条回答
  •  无人共我
    2021-01-13 04:58

    I would keep the socket open if you are worried about instant messaging, it takes time to setup the socket connection especially if you are using the GSM connection. I have seen it take 10 secs or more to open up a socket on 3G, much less if on WiFi.

提交回复
热议问题