In our Jar file, we want to be able to test the success of a network connection. To do this first we check the player profile:
if ("YES".equals(System.getProperty("bluray.profile.2"))) ...
Then we run the test to see if the player is actually connected. To do this I have tried both the HttpUtil class from the twitter example, and also this instead:
public boolean doSimulationTest(String path)
boolean success = false;
InputStream is = null;
URL url = new URL(path);
HttpURLConnection server = (HttpURLConnection) url.openConnection();
is = server.getInputStream();
String response = getUpdates(server, is, null);
success = true;
catch (Exception e)
if (is != null)
catch (Exception ex)
In each version the results are as we would expect on all players except the Panasonic BD15 and Panasonic BD35. Both players appear to hang for upto 40seconds before returning. However, every other player returns almost instantly. So..
Is there an alternative approach to do a connection test?
Or are there known workarounds for these 2 players?
Or is there a way to set the timeout of a http connection? I have seen references to the system property sun.net.client.defaultReadTimeout. Can this be used?
Many thanks for any suggestions.