Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.fourthline.cling.transport.spi
Interface StreamClient<C extends StreamClientConfiguration>

Type Parameters:
  `C` - The type of the service's configuration.

All Known Implementing Classes:
  StreamClientImpl, StreamClientImpl, StreamClientImpl

    public interface StreamClient<C extends StreamClientConfiguration>

Service for sending TCP (HTTP) stream request messages.

An implementation has to be thread-safe. Its constructor may throw `InitializationException`.

Author:
  Christian Bauer

Method Summary
`C` | `getConfiguration()`
`StreamResponseMessage` | `sendRequest(StreamRequestMessage message)` Sends the given request via TCP (HTTP) and returns the response.
`void` | `stop()` Stops the service, closes any connection pools etc.

Method Detail

### sendRequest

    StreamResponseMessage sendRequest(StreamRequestMessage message)

  Sends the given request via TCP (HTTP) and returns the response.

  This method will always try to complete execution without throwing an exception. It will return `null` if an error occurs, and optionally log any exception messages.

  This method is required to add a `Host` HTTP header to the outgoing HTTP request, even if the given `StreamRequestMessage` does not contain such a header.

  This method will add the `User-Agent` HTTP header to the outgoing HTTP request if the given message did not already contain such a header. You can set this default value in your `StreamClientConfiguration`.

  Parameters:
    `message` - The message to send.
  Returns:
    The response or `null` if no response has been received or an error occurred.

### stop

    void stop()

  Stops the service, closes any connection pools etc.

### getConfiguration

    C getConfiguration()

  Returns:
    This service's configuration.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2013 4th Line GmbH, Switzerland. All Rights Reserved.