public class Server extends ServerSocket
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BACKLOG |
Constructor and Description |
---|
Server(int port,
ISocketAcceptHandler handler) |
Server(ThreadGroup group,
int port,
InetAddress bindAddress,
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,
ISocketAcceptHandler handler) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
debug(String msg) |
protected void |
handleAccept(Socket aSocket) |
protected Thread |
setupListener() |
protected void |
traceStack(String msg,
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(ThreadGroup group, int port, int backlog, InetAddress bindAddress, ISocketAcceptHandler handler) throws IOException
group
- thread group for created threadsport
- portbacklog
- backlogbindAddress
- a bindAddresshandler
- the socket accept handlerIOException
- if server setup cannot be donepublic Server(ThreadGroup group, int port, InetAddress bindAddress, ISocketAcceptHandler handler) throws IOException
group
- thread group for created threadsport
- portbindAddress
- a bindAddresshandler
- the socket accept handlerIOException
- if server setup cannot be donepublic Server(ThreadGroup group, int port, int backlog, ISocketAcceptHandler handler) throws IOException
group
- thread group for created threadsport
- portbacklog
- backloghandler
- the socket accept handlerIOException
- if server setup cannot be donepublic Server(ThreadGroup group, int port, ISocketAcceptHandler handler) throws IOException
IOException
public Server(int port, ISocketAcceptHandler handler) throws IOException
IOException
protected void debug(String msg)
protected Thread setupListener()
protected void handleAccept(Socket aSocket)
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class ServerSocket
IOException
Copyright © 2017. All rights reserved.