Closed iadnan closed 9 years ago
The cause is: the web server isn't stopped when the first device is disconnected and is still receiving events from it; also, a new instance cannot bind to the same port, and we don't receive events from the second device.
Steps to reproduce:
[DEBUG] Connection received 679 bytes on socket 13
[DEBUG] Connection on socket 13 preflighting request "NOTIFY /MediaRenderer/RenderingControl/Event" with 679 bytes body
[DEBUG] Connection on socket 13 processing request "NOTIFY /MediaRenderer/RenderingControl/Event" with 679 bytes body
[DEBUG] Connection sent 122 bytes on socket 13
[DEBUG] Did close connection on socket 13
Actual result: the events are still received and processed.
Expected result: the web server responsible for listening to DLNA events should be shut down, so the events aren't processed.
ps. stupid markdown parser doesn't want to continue the numbered list properly
Currently, in DLNAService
the only expected way to stop the web server is to unsubscribe from all the subscribed subscriptions, which doesn't happen on disconnect.
The subscriptions are unsubscribed and the server is stopped on disconnect. The fix is available in https://github.com/eunikolsky/Connect-SDK-iOS-Core/tree/bugfix/118_dlna_disconnectfix. It's working properly on disconnect. The only thing to test is whether it works properly on suspending & resuming the app.
FIXME: if an app connects to 2+ DLNA devices at the same time, the events from the second device (most likely) won't work, because the DLNA server uses a static port, and the second instance won't be able to bind to it. We'll need to use dynamic ports later.
Merged in Full and Lite.
The DLNA subscriptions should stop once the device gets disconnected