All Packages This Package Class Hierarchy Class Search Index
java.lang.Object | +----edu.utah.janos.antsr.core.WatchDog
Summary |
class WatchDog extends java.lang.Object implements java.lang.Runnable { // Fields 3 private static final int MAX_SOCKET_BACKLOG; private final Node node; private final ServerSocket socket; // Constructors 1 WatchDog(Node, int) throws IOException; // Methods 4 void accept(); int getPort(); public void run(); public String toString(); // Inner Classes 1 private class WatchDog.Worker }
A simple watch dog class, it opens a network port and prints out little messages to whoever has connected to it.
Fields |
· MAX_SOCKET_BACKLOG | Summary | Top |
private static final int MAX_SOCKET_BACKLOG
· socket | Summary | Top |
private final ServerSocket socket
The socket this watch dog listens on.
· node | Summary | Top |
private final Node node
Constructors |
· WatchDog | Summary | Top |
WatchDog(Node node, int port) throws IOException
Create a WatchDog listener on the given port. Blows up if the port is already in use, throwing an IOException.
Connections will not be handled until the
accept()
method is executed. You'd best supply a new thread to handle them, too.
Parameter Description port the port to use; zero for any free port.
- Throws: IOException
- throws whatever errors ServerSocket might toss your way.
See Also: accept
Methods |
· getPort | Summary | Top |
int getPort()
Return the port this watch dog server listens on
· toString | Summary | Top |
public String toString()
- Overrides:
- toString in class Object
· run | Summary | Top |
public void run()
- Implements:
- run in interface Runnable
· accept | Summary | Top |
void accept()
Accept and handle connections on this watch dog.
This call never returns.
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7