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.impl.apache
Class StreamServerImpl

    java.lang.Object
      org.fourthline.cling.transport.impl.apache.StreamServerImpl

All Implemented Interfaces:
  Runnable, StreamServer<StreamServerConfigurationImpl>

    public class StreamServerImpl

extends Object
implements StreamServer<StreamServerConfigurationImpl>

Implementation based on Apache HTTP Components 4.2.

This implementation DOES NOT WORK on Android. Read the Cling manual for alternatives on Android.

Author:
  Christian Bauer

Field Summary
`protected StreamServerConfigurationImpl` | `configuration`
`protected org.apache.http.params.HttpParams` | `globalParams`
`protected Router` | `router`
`protected ServerSocket` | `serverSocket`

Constructor Summary
`StreamServerImpl(StreamServerConfigurationImpl configuration)`

Method Summary
`StreamServerConfigurationImpl` | `getConfiguration()`
`int` | `getPort()` This method will be called potentially right after `StreamServer.init(java.net.InetAddress, org.fourthline.cling.transport.Router)`, the actual assigned local port must be available before the server is started.
`void` | `init(InetAddress bindAddress, Router router)` Configures the service and starts any listening sockets.
`void` | `run()`
`void` | `stop()` Stops the service, closes any listening sockets.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### configuration

    protected final StreamServerConfigurationImpl configuration

### router

    protected Router router

### serverSocket

    protected ServerSocket serverSocket

### globalParams

    protected org.apache.http.params.HttpParams globalParams

Constructor Detail

### StreamServerImpl

    public StreamServerImpl(StreamServerConfigurationImpl configuration)

Method Detail

### getConfiguration

    public StreamServerConfigurationImpl getConfiguration()

  Specified by:
    `getConfiguration` in interface `StreamServer<StreamServerConfigurationImpl>`
  Returns:
    This service's configuration.

### init

    public void init(InetAddress bindAddress,
                     Router router)
              throws InitializationException

  Description copied from interface: `StreamServer`
  Configures the service and starts any listening sockets.

  Specified by:
    `init` in interface `StreamServer<StreamServerConfigurationImpl>`
  Parameters:
    `bindAddress` - The address to bind any sockets on.
    `router` - The router which handles the incoming `UpnpStream`.
  Throws:
    `InitializationException` - If the service could not be initialized or started.

### getPort

    public int getPort()

  Description copied from interface: `StreamServer`
  This method will be called potentially right after `StreamServer.init(java.net.InetAddress, org.fourthline.cling.transport.Router)`, the actual assigned local port must be available before the server is started.

  Specified by:
    `getPort` in interface `StreamServer<StreamServerConfigurationImpl>`
  Returns:
    The TCP port this service is listening on, e.g. the actual ephemeral port.

### stop

    public void stop()

  Description copied from interface: `StreamServer`
  Stops the service, closes any listening sockets.

  Specified by:
    `stop` in interface `StreamServer<StreamServerConfigurationImpl>`

### run

    public void run()

  Specified by:
    `run` in interface `Runnable`

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.