com.ch.odi.net
Class PortListenerThread
java.lang.Object
|
+--com.ch.odi.net.PortListener
|
+--com.ch.odi.net.PortListenerThread
- public class PortListenerThread
- extends PortListener
- implements Runnable
Description: Wraps a PortListener into its own thread. When the thread is started
the underlying PortListener's listen method is called.
Usage:
Thread webServer = new Thread(new PortListenerThread(80, new WebServer()));
webServer.start();
|
Method Summary |
void |
run()
Starts listening. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
PortListenerThread
public PortListenerThread(int port,
ConnectionHandler handler)
- Creates a new PortListenerThread
- Parameters:
port - The TCP port to listen onhandler - The custom handler object to handle incoming connections
run
public void run()
- Starts listening. Calles by the Thread object.
- Specified by:
- run in interface Runnable