/** * Sends the TCP stream request with the {@link org.fourthline.cling.transport.spi.StreamClient}. * * @param msg The TCP (HTTP) stream message to send. * @return The return value of the {@link org.fourthline.cling.transport.spi.StreamClient#sendRequest(StreamRequestMessage)} * method or <code>null</code> if no <code>StreamClient</code> is available. */ public StreamResponseMessage send(StreamRequestMessage msg) throws RouterException { lock(readLock); try { if (enabled) { if (streamClient == null) { log.fine("No StreamClient available, not sending: " + msg); return null; } log.fine("Sending via TCP unicast stream: " + msg); try { return streamClient.sendRequest(msg); } catch (InterruptedException ex) { throw new RouterException("Sending stream request was interrupted", ex); } } else { log.fine("Router disabled, not sending stream request: " + msg); return null; } } finally { unlock(readLock); } }
/** * Sends the TCP stream request with the {@link org.fourthline.cling.transport.spi.StreamClient}. * * @param msg The TCP (HTTP) stream message to send. * @return The return value of the {@link org.fourthline.cling.transport.spi.StreamClient#sendRequest(StreamRequestMessage)} * method or <code>null</code> if no <code>StreamClient</code> is available. */ public StreamResponseMessage send(StreamRequestMessage msg) throws RouterException { lock(readLock); try { if (enabled) { if (streamClient == null) { log.fine("No StreamClient available, not sending: " + msg); return null; } log.fine("Sending via TCP unicast stream: " + msg); try { return streamClient.sendRequest(msg); } catch (InterruptedException ex) { throw new RouterException("Sending stream request was interrupted", ex); } } else { log.fine("Router disabled, not sending stream request: " + msg); return null; } } finally { unlock(readLock); } }
/** * Sends the TCP stream request with the {@link org.fourthline.cling.transport.spi.StreamClient}. * * @param msg The TCP (HTTP) stream message to send. * @return The return value of the {@link org.fourthline.cling.transport.spi.StreamClient#sendRequest(StreamRequestMessage)} * method or <code>null</code> if no <code>StreamClient</code> is available. */ public StreamResponseMessage send(StreamRequestMessage msg) throws RouterException { lock(readLock); try { if (enabled) { if (streamClient == null) { log.fine("No StreamClient available, not sending: " + msg); return null; } log.fine("Sending via TCP unicast stream: " + msg); try { return streamClient.sendRequest(msg); } catch (InterruptedException ex) { throw new RouterException("Sending stream request was interrupted", ex); } } else { log.fine("Router disabled, not sending stream request: " + msg); return null; } } finally { unlock(readLock); } }