public class Server
extends java.net.ServerSocket
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BACKLOG |
Constructor and Description |
---|
Server(int port,
ISocketAcceptHandler handler) |
Server(java.lang.ThreadGroup group,
int port,
java.net.InetAddress bindAddress,
ISocketAcceptHandler handler) |
Server(java.lang.ThreadGroup group,
int port,
int backlog,
java.net.InetAddress bindAddress,
ISocketAcceptHandler handler) |
Server(java.lang.ThreadGroup group,
int port,
int backlog,
ISocketAcceptHandler handler) |
Server(java.lang.ThreadGroup group,
int port,
ISocketAcceptHandler handler) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
debug(java.lang.String msg) |
protected void |
handleAccept(java.net.Socket aSocket) |
protected java.lang.Thread |
setupListener() |
protected void |
traceStack(java.lang.String msg,
java.lang.Throwable e) |
accept, bind, bind, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSocketFactory, setSoTimeout, toString
public static final int DEFAULT_BACKLOG
public Server(java.lang.ThreadGroup group, int port, int backlog, java.net.InetAddress bindAddress, ISocketAcceptHandler handler) throws java.io.IOException
group
- thread group for created threadsport
- portbacklog
- backlogbindAddress
- a bindAddresshandler
- the socket accept handlerjava.io.IOException
- if server setup cannot be donepublic Server(java.lang.ThreadGroup group, int port, java.net.InetAddress bindAddress, ISocketAcceptHandler handler) throws java.io.IOException
group
- thread group for created threadsport
- portbindAddress
- a bindAddresshandler
- the socket accept handlerjava.io.IOException
- if server setup cannot be donepublic Server(java.lang.ThreadGroup group, int port, int backlog, ISocketAcceptHandler handler) throws java.io.IOException
group
- thread group for created threadsport
- portbacklog
- backloghandler
- the socket accept handlerjava.io.IOException
- if server setup cannot be donepublic Server(java.lang.ThreadGroup group, int port, ISocketAcceptHandler handler) throws java.io.IOException
java.io.IOException
public Server(int port, ISocketAcceptHandler handler) throws java.io.IOException
java.io.IOException
protected void debug(java.lang.String msg)
protected void traceStack(java.lang.String msg, java.lang.Throwable e)
protected java.lang.Thread setupListener()
protected void handleAccept(java.net.Socket aSocket)
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.net.ServerSocket
java.io.IOException