Android如何维护网络连接
我想知道Android如何将ppp连接维持在低级别(不是应用程序级别)。
具体来说,当ppp连接失败(无信号或任何原因)时,android如何感知它并尝试重新连接?它会定期测试连接吗?如果是这样,间隔是多少?
我探索了 system/netd 以及 NetworkManagementService.java、ConnectivityService.java 和其他一些相关对象。我还是没能弄清楚其中的原因。
请指教。谢谢,
I want to know how Android maintain the ppp connection at low level (not application level.)
To be specific, when the ppp connection failed (no signal or whatever reason), how did android sense it and try to reconnect? Does it periodically test the connection? if so, what's the interval?
I explored system/netd along with NetworkManagementService.java, ConnectivityService.java and some other related objects. I still couldn't figure the reason out.
Please advise. Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对我来说,听起来好像您想知道如何在操作系统级别维护网络连接(您确定您的意思是“ PPP”连接?)。
Android本身基于C.在C中编写的Linux,如果您想深入研究网络代码,那么它是免费的,尽管在首先探索PPP协议时可能值得,因为这可能会给您一个“更高级别”维护而不是检查原始代码。
Java代码将是高水平的,并且不会像您的研究发现有关较低级别的工作是否有很多信息。
我不确定在移动/GSM连接上使用了哪些协议,但是我敢肯定,互联网或Wikipedia上的戳戳会揭示事物。
Sounds to me as though you want to know how network connection is maintained at operating system level (and are you sure you mean a 'ppp' connection?).
Android itself is based on Linux which is written in C. If you want to delve into the networking code then it's freely available although it might be worth while exploring the ppp protocol first as this may give you a 'higher level' of how a connection is maintained rather than examining raw code.
The java code will be high level and won't as your research discovered reveal much if anything about the lower level workings.
I'm not sure what protocols are used on mobile/gsm connections but I'm sure a poke around on the internet or Wikipedia will reveal things.