4thline / cling

UPnP/DLNA library for Java and Android
1.72k stars 600 forks source link

Server and/or Renderer cannot be found after switching WiFi networks. #152

Open kleber-maia opened 8 years ago

kleber-maia commented 8 years ago

This is weird, because theres is an issue (https://github.com/4thline/cling/issues/134) describing exactly the problem I've been experiencing, but seems that nobody understood it. So, I'm gonna try to explain better:

  1. The Android device is connected on WiFi network A.
  2. I run my app and its MediaServer and MediaRenderer can be found by other devices connected on WiFi network A.
  3. With the app still being executed, I change the Android device from WiFi network A to B.
  4. No one of the devices connected on network B can find my MediaServer or MediaRenderer.

First thing I did notice is that the current IP address of the Android device is not being updated inside Cling's objects. So, when a MediaController tries to obtain my app's MediaServer/MediaRenderer description.xml, I got an exception showing:

W/StreamClient: HTTP connection failed: (StreamRequestMessage) GET http://192.168.43.1:4004/description.xml

The IP address on message above is the one obtained from WiFi network A, but the Android device is now connected to WiFi network B with another IP address.

Does it make now make sense for you guys? Thanks for any help.

kleber-maia commented 8 years ago

Just trying to be more clear, I do have UPnP devices on both networks A and B. And the expected behavior is that my app's MediaServer and MediaRenderer should be able to been seen by the devices on the same network the Android device is currently connected to. I don't think Cling's objects are "refreshing" the current device's IP address after switching network.

ened commented 8 years ago

It does make sense and I noticed such issue as well. It should be worked on within the AndroidRouter class. Happy to see contributions on this.

Taranmeet commented 6 years ago

@kleber-maia @ened Did you guys found any work around?