Package org.eclipse.ecf.provider.comm.tcp

## Class Server

- java.lang.Object
- - java.net.ServerSocket
  - - org.eclipse.ecf.provider.comm.tcp.Server

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

    public class Server
    extends ServerSocket

### Field Summary

Fields
`static int` `DEFAULT_BACKLOG`

### Constructor Summary

Constructors
`Server​(int port, ISocketAcceptHandler handler)`
`Server​(ThreadGroup group, int port, int backlog, InetAddress bindAddress, ISocketAcceptHandler handler)`
`Server​(ThreadGroup group, int port, int backlog, ISocketAcceptHandler handler)`
`Server​(ThreadGroup group, int port, InetAddress bindAddress, ISocketAcceptHandler handler)`
`Server​(ThreadGroup group, int port, ISocketAcceptHandler handler)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()`
`protected void` `debug​(String msg)`
`protected void` `handleAccept​(Socket aSocket)`
`protected Thread` `setupListener()`
`protected void` `traceStack​(String msg, Throwable e)`

### Methods inherited from class java.net.ServerSocket

`accept, bind, bind, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getOption, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setOption, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSocketFactory, setSoTimeout, supportedOptions, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### DEFAULT_BACKLOG

    public static final int DEFAULT_BACKLOG

See Also:
  Constant Field Values

### Constructor Detail

#### Server

    public Server​(ThreadGroup group,
                  int port,
                  int backlog,
                  InetAddress bindAddress,
                  ISocketAcceptHandler handler)
           throws IOException

Parameters:
  `group` - thread group for created threads
  `port` - port
  `backlog` - backlog
  `bindAddress` - a bindAddress
  `handler` - the socket accept handler
Throws:
  `IOException` - if server setup cannot be done
Since:
  4.4

#### Server

    public Server​(ThreadGroup group,
                  int port,
                  InetAddress bindAddress,
                  ISocketAcceptHandler handler)
           throws IOException

Parameters:
  `group` - thread group for created threads
  `port` - port
  `bindAddress` - a bindAddress
  `handler` - the socket accept handler
Throws:
  `IOException` - if server setup cannot be done
Since:
  4.4

#### Server

    public Server​(ThreadGroup group,
                  int port,
                  int backlog,
                  ISocketAcceptHandler handler)
           throws IOException

Parameters:
  `group` - thread group for created threads
  `port` - port
  `backlog` - backlog
  `handler` - the socket accept handler
Throws:
  `IOException` - if server setup cannot be done
Since:
  4.4

#### Server

    public Server​(ThreadGroup group,
                  int port,
                  ISocketAcceptHandler handler)
           throws IOException

Throws:
  `IOException`

#### Server

    public Server​(int port,
                  ISocketAcceptHandler handler)
           throws IOException

Throws:
  `IOException`

### Method Detail

#### debug

    protected void debug​(String msg)

#### traceStack

    protected void traceStack​(String msg,
                              Throwable e)

#### setupListener

    protected Thread setupListener()

#### handleAccept

    protected void handleAccept​(Socket aSocket)

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Overrides:
  `close` in class `ServerSocket`
Throws:
  `IOException`