开发者

About Wi-Fi connection after screen is locked of iPhone 3.1.3 and later

I studied the iOS programming guide in the iOS SDK. In that in "Tuning for Performance and Responsive ss" section I am having problem. In the subsection named "Using Wi-Fi" under the above section there is one note which is like below:

Note: Note that even when UIRequiresPersistentWiFi has a value of true, it has no effect when the device is idle (that is, screen-locked). The application is considered inactive, and although it may function on some levels, it has no Wi-Fi connection. According to my interpretation what this note says is that once the screen is locked of iPhone there is no Wi-Fi connection with iPhone. To check this what I did is, I implemented one simple application which sen开发者_开发知识库ds one UDP packet every 6 minutes and then sleeps using usleep function of C. Now after starting this application I lock my iPhone with the button above iPhone, but still it can send the packet every 6 minute. If Wi-Fi connection really gets closed according to above note then how can it send the packet. I seen the packet in wireshark, it is having the ip address what Wi-Fi router provided to it. So I think documentation of iPhone SDK is wrong.


You didn't say if the iPhone is in its dock when you did the test. With the screen locked and the charging cable disconnected the iPhone will close the Wifi connection. When the charging cable is connected then the WIfi connection will remain open.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜