Android????????о?
???????????? ???????[ 2016/3/11 11:33:00 ] ???????????????
???????
???????о?Android????????? ?о??????????? ?????????? д????????????? ?????2?. ????????????Щ????????????????????? ?????Щ??????? ?????????????.
?????????о?Android???????? ????????????????????????app?? ?????????????罻app??? ??????????????ó????? ?????????????????????С?????? ????????о?????? ?????????? ?????????????? ??????????????????? ??????.
????Android????????????????
????????????У? ????????????????? ????????????? ?????????????????? ??????????????е????????? ??????????????? ?????????? ???????????????????????? ??????????????????????????? ???????????????? ?????????????????????.
?????????????? ????????????????????????:
???????
??????????????????????????μ?????? ?????????????ù?????????????? ?????????? ??????????.
??????????????? ?????Щ??????????????????? ?????? ????????????趨?????С????Σ? ?????????????.
?????????????????????? ????????????????. ???輴???????????糩???????·????????????10s????????? ?????????? ????????????5s????η??????? ??????????? ?????????????????????????.
????SMS??
?????????????????????п????? ?????????????????? ????????????????????????????????????????? ???????????????????????????У? ?????????????????????????.
???????????????? ???????????? ???????????治??.
??????????
????????????????????????? ????????????????????TCP????????? ??????????????????????????? ?????????? ?????????????????????????TCP???????????.
????XMPP?? MQTT????????????
?????????????????????? ????????XMPPЭ??????Android?????MQTTЭ??????Android????? ???????????????????????? XMPP??MQTT???????Э?飬 ?????????????????????Э?鶴????????? ????????????????? ?????????????TCP/IP?????????ò??? ?????????????? ???????ò? ????????????????? ????????????XMPP?? MQTT?????????????.
???????????XMPP?? ???????????ο?Openfire??Smack????????? ????????????aSmack??Openfire??IM?? ???????????????????? ???????????? ??????Openfire??????????? ??????Щ?????????????????????????????????????? ???????????? ????μ?.
??????TCP????????????
?????????????????????? ?????????? ????????????? ??????????????? ???????????? ??????????????????? ?????????????????? ?????????TCP????????????
????????????????о?????????????????? ?????Щ??????к???????? ????????????????£? ????????????.
?????????????
?????????????? ??????????????????????????????????? ?????????????????????.
????persistent connection
???????????????????????? ?????????. ?????????????? ????????????????????? ?????????????????????????????????.
????TCP???????????????????ν???????? ??????????????????????????? ????????????????.
?????????????е??????????? ????????????ж?. ???????????????????·??????????? ?????????崻???? ???????????????????? ??Щ?????Щī????????????????ж??????? ???м??????????:
????NAT???
???????IPv4??????? ?????????????????·?????????? ??????豸??????????NAT?豸????棬 ?????г?????NAT?豸?????·????.
????NAT?豸????IP???????豸?????/???IP???. ???????·????????? ??????????????????(NAPT)?? ????????IP?? ?????TCP??UDPЭ??????? ?????????????е??豸????????????IP. ???????? NAPT???????????±??NAT??
???? ??????? ???????
????192.168.0.2:5566 120.132.92.21:9200
????192.168.0.3:7788 120.132.92.21:9201
????192.168.0.3:8888 120.132.92.21:9202
????NAT?豸?????NAT?????????????????????? ???罫192.168.0.3:8888????????????120.132.92.21:9202?? ??????????????120.132.92.21:9202???. ??NAT?豸??120.132.92.21:9202?????????IP??????192.168.0.3:8888?? ????????????????? ?????????????????????? ?????????192.168.0.3:8888 == 120.132.92.21:9202??????????Щ???NAT?豸?????? ??????豸????????192.168.0.3:8888?????.
??????????豸?????????NAT?豸????棬 ???????????У????? ??????????????IP?? ?????????IP?? ??????????NAT?豸???棬 ?????????????????·?????? ?????????????????????????NAT.
????????????????????????????·????????????????????? ?????NAT???е????? ?????·?ж?.
???????????л?
????????????WIFI?????л??? ?????????????????? ????????????. ????????????? ??????????IP????? ????????????????.
????DHCP??????
???????????????????DHCP???????Bug?? DHCP???????????????????????????ù???IP?? ???????????TCP?????????????.
????????Android???????????????
????????????????
???????????????????????????:
??????????????? ????????????????????.
?????????????????????????????????.
?????????Щ?????????????????????. ??Щ??????????? ??????д?????. ?????????: “??????????”? ??????: “???????????????????”. ?????????????? ????????????????ó????? ?????????·?????????.
?????????? TCP??????????????????????????? ???????????? ?????????????????wifi?? ????????????????????? ?????????????????????KeepAlive??Socket??????????? ??????????????? ·????????磬 DHCP???????? ???????? ??????С??????????????????????????TCP???????????????? ????????????.
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11