protected Location getDescriptorLocation(NetworkAddress activeStreamServer, LocalDevice device) { return new Location( activeStreamServer, getUpnpService().getConfiguration().getNamespace().getDescriptorPathString(device) ); }
protected void execute() throws RouterException { List<NetworkAddress> activeStreamServers = getUpnpService().getRouter().getActiveStreamServers(null); if (activeStreamServers.size() == 0) { log.fine("Aborting notifications, no active stream servers found (network disabled?)"); return; } // Prepare it once, it's the same for each repetition List<Location> descriptorLocations = new ArrayList<>(); for (NetworkAddress activeStreamServer : activeStreamServers) { descriptorLocations.add( new Location( activeStreamServer, getUpnpService().getConfiguration().getNamespace().getDescriptorPathString(getDevice()) ) ); } for (int i = 0; i < getBulkRepeat(); i++) { try { for (Location descriptorLocation : descriptorLocations) { sendMessages(descriptorLocation); } // UDA 1.0 is silent about this but UDA 1.1 recomments "a few hundred milliseconds" log.finer("Sleeping " + getBulkIntervalMilliseconds() + " milliseconds"); Thread.sleep(getBulkIntervalMilliseconds()); } catch (InterruptedException ex) { log.warning("Advertisement thread was interrupted: " + ex); } } }
protected Location getDescriptorLocation(NetworkAddress activeStreamServer, LocalDevice device) { return new Location( activeStreamServer, getUpnpService().getConfiguration().getNamespace().getDescriptorPathString(device) ); }
protected void execute() throws RouterException { List<NetworkAddress> activeStreamServers = getUpnpService().getRouter().getActiveStreamServers(null); if (activeStreamServers.size() == 0) { log.fine("Aborting notifications, no active stream servers found (network disabled?)"); return; } // Prepare it once, it's the same for each repetition List<Location> descriptorLocations = new ArrayList<>(); for (NetworkAddress activeStreamServer : activeStreamServers) { descriptorLocations.add( new Location( activeStreamServer, getUpnpService().getConfiguration().getNamespace().getDescriptorPathString(getDevice()) ) ); } for (int i = 0; i < getBulkRepeat(); i++) { try { for (Location descriptorLocation : descriptorLocations) { sendMessages(descriptorLocation); } // UDA 1.0 is silent about this but UDA 1.1 recomments "a few hundred milliseconds" log.finer("Sleeping " + getBulkIntervalMilliseconds() + " milliseconds"); Thread.sleep(getBulkIntervalMilliseconds()); } catch (InterruptedException ex) { log.warning("Advertisement thread was interrupted: " + ex); } } }