Kittsy / upnpx

Automatically exported from code.google.com/p/upnpx
0 stars 0 forks source link

iOS 5.x destroys sockets on standby (screen lock) - thereafter searchSSDP::Search leads to crash #10

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Do a Discovery search (e.g.  [[[UPnPManager GetInstance] SSDP] searchSSDP]; )
2. Press the standby (screen lock button)
3. Call Discovery search again.  (e.g.  [[[UPnPManager GetInstance] SSDP] 
searchSSDP]; )

What is the expected output? What do you see instead?
App crashes in ssdp.cpp on sendto(...) because sockets are no longer valid

What version of the product are you using? On what operating system?
I saw this on iOS 5.1.1 and upnpx 1.2.4.

Please provide any additional information below.
This is a new problem in iOS 5 
(http://stackoverflow.com/questions/8270860/locking-iphone-disconnects-sockets-o
n-ios-5-only)

Original issue reported on code.google.com by hey68...@gmail.com on 21 May 2012 at 2:36

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This is a small hack I did to make my app work after being put to the 
background/locked.

Also I added the following to the AppDelegate applicationWillResignActive / 
applicationDidBecomeActive:

    UPnPManager *manager = [UPnPManager GetInstance];
    [[manager SSDP] stopSSDP];
    [[manager upnpEvents] stop];

and

    UPnPManager *manager = [UPnPManager GetInstance];
    [[manager upnpEvents] start];
    [[manager SSDP] startSSDP];

Original comment by thiagoss...@gmail.com on 26 Jun 2013 at 7:05

Attachments: