public class TCPServer extends TCPCommunicator implements Runnable
| Constructor and Description |
|---|
TCPServer(int portNo)
Create a connection server on given server port
|
| Modifier and Type | Method and Description |
|---|---|
void |
acceptIncomingConnection()
Accept an incoming connection
|
Selector |
addServerSocket(Selector selector)
Add server socket (the one that receives 'accept' notifications) to given selector
|
void |
closeServer()
Close server communication
|
void |
makeNonBlocking()
Make socket non blocking
|
void |
run()
Server main loop (for non-blocking communication)
|
addCommunicationSocket, addTCPMessageListener, close, getSelector, readMessage, readStringMessage, removeTCPMessageListener, sendMessage, sendMessage, sendMessage, toStringpublic TCPServer(int portNo)
public void makeNonBlocking()
public Selector addServerSocket(Selector selector)
public void acceptIncomingConnection()
throws IOException
IOExceptionpublic void closeServer()
Copyright © 2021. All rights reserved.