|
|||||||||
Atavism Version 2018.1 | AGIS API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatavism.server.network.TcpServer
public class TcpServer
binds on a port and accepts new connections on its own private thread. calls registered callback on accepting a new connection.
Field Summary | |
---|---|
protected TcpAcceptCallback |
acceptCallback
|
protected static Logger |
log
|
protected java.nio.channels.ServerSocketChannel |
ssChannel
|
protected java.lang.Thread |
thread
|
Constructor Summary | |
---|---|
TcpServer()
|
|
TcpServer(int port)
|
Method Summary | |
---|---|
void |
bind()
binds to a random local port and the wildcard address |
void |
bind(java.net.InetAddress address,
int port)
binds to specified tcp port and the specified address, and starts accepting incoming connections |
void |
bind(java.net.InetSocketAddress address)
|
void |
bind(int port)
binds to specified tcp port and the wildcard address, and starts accepting incoming connections |
void |
bind(java.lang.String hostname,
int port)
binds to specified tcp port and the address matching the specified hostname, and starts accepting incoming connections |
java.net.InetAddress |
getAddress()
|
int |
getPort()
|
java.lang.Thread |
getThread()
|
void |
registerAcceptCallback(TcpAcceptCallback cb)
|
void |
start()
start processing new incoming connections and also handle requests |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected TcpAcceptCallback acceptCallback
protected java.nio.channels.ServerSocketChannel ssChannel
protected java.lang.Thread thread
protected static final Logger log
Constructor Detail |
---|
public TcpServer()
public TcpServer(int port)
Method Detail |
---|
public void bind() throws java.io.IOException
java.io.IOException
public void bind(int port) throws java.io.IOException
java.io.IOException
public void bind(java.lang.String hostname, int port) throws java.io.IOException
java.io.IOException
public void bind(java.net.InetAddress address, int port) throws java.io.IOException
java.io.IOException
public void bind(java.net.InetSocketAddress address) throws java.io.IOException
java.io.IOException
public int getPort()
public java.net.InetAddress getAddress()
public void registerAcceptCallback(TcpAcceptCallback cb)
public java.lang.Thread getThread()
public void start()
|
Copyright © 2018 Dragonsan Studios Sp. z o.o. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |