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 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
All Methods Instance Methods Concrete Methods 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
-
-
-
-
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 threadsport
- portbacklog
- backlogbindAddress
- a bindAddresshandler
- 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 threadsport
- portbindAddress
- a bindAddresshandler
- 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 threadsport
- portbacklog
- backloghandler
- 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)
-
setupListener
protected Thread setupListener()
-
handleAccept
protected void handleAccept(Socket aSocket)
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classServerSocket
- Throws:
IOException
-
-