All Packages This Package Class Hierarchy Class Search Index
Class edu.utah.janos.ants.ants.Console
java.lang.Object
|
+----edu.utah.janos.ants.ants.Console
class Console
extends java.lang.Object
implements java.lang.Runnable
{
// Fields 7
private static final int MAX_SOCKET_BACKLOG;
private boolean done;
private LineNumberReader in;
private final Node node;
private PrintWriter out;
private final ServerSocket socket;
private static final Status status;
// Constructors 1
Console(Node, int) throws IOException;
// Methods 10
void accept();
private void banner();
private final void dumpStrings(String[]);
private String[] getCommand() throws IOException;
int getPort();
private void handleClient() throws IOException;
public void run();
private void runCommand(String[]);
public String toString();
private void usage();
}
private static final int MAX_SOCKET_BACKLOG
private static final Status status
private final ServerSocket socket
The socket this console listens on.
private final Node node
private PrintWriter out
private LineNumberReader in
private boolean done
Console(Node node,
int port) throws IOException
Create a Console 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
int getPort()
Return the port this console server listens on
public String toString()
- Overrides:
- toString in class Object
public void run()
- Implements:
- run in interface Runnable
void accept()
Accept and handle connections on this Console.
This call never returns.
private void handleClient() throws IOException
private void banner()
private String[] getCommand() throws IOException
private void usage()
private final void dumpStrings(String[] s)
private void runCommand(String[] args)
All Packages This Package Class Hierarchy Class Search Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7