public class TCPListener extends java.lang.Object implements java.lang.Runnable, ConnectionCloseListener
Each incoming connection will be handled in a separate thread.
| Modifier and Type | Method and Description |
|---|---|
void |
connectionClosed(TCPConnection connection) |
boolean |
equals(java.lang.Object obj) |
int |
getPort() |
int |
hashCode() |
boolean |
isRunning()
Indicates whether this listener is running or not.
|
void |
kill()
Stops the TCP listener and kills all established connection.
|
void |
run() |
boolean |
start()
Starts the TCP listener.
|
void |
stop()
Stops the TCP listener.
|
public void run()
run in interface java.lang.Runnablepublic boolean isRunning()
true if the listener is running and will handle incoming TCP connections, false
otherwise.public boolean start()
true if the listener is started or already running, false otherwise.public void stop()
throws java.io.IOException
Existing TCP connection will remain active! To stop the TCP server and close all established connections.
java.io.IOExceptionpublic void kill()
throws java.io.IOException
This will also close all established connections.
java.io.IOExceptionpublic int getPort()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic void connectionClosed(TCPConnection connection)
connectionClosed in interface ConnectionCloseListener