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
Modifier and Type
Field
Description
`static final int`
`DEFAULT_BACKLOG`

## Constructor Summary

Constructors
Constructor
Description
`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

Modifier and Type
Method
Description
`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 Details

### DEFAULT_BACKLOG

public static final int DEFAULT_BACKLOG

See Also:
  - Constant Field Values

## Constructor Details

### 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 Details

### 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`