RiverRat - An MIT iCampus project | http://web.mit.edu/riverrat/ |
Inheritance diagram for riverrat.BasicServer:
Public Member Functions | |
BasicServer () | |
Default constructor. | |
BasicServer (int newport) | |
Constructor. | |
void | startDocument () |
StartDocument. | |
void | startElement (String uri, String local, String raw, Attributes attrs) |
StartElement. | |
void | endElement (String uri, String local, String raw) |
EndElement. | |
void | endDocument () |
EndDocument. | |
void | warning (SAXParseException ex) throws SAXException |
Warning. | |
void | error (SAXParseException ex) throws SAXException |
Error. | |
void | fatalError (SAXParseException ex) throws SAXException |
Fatal Error. | |
void | setSocket (Socket s) |
Sets the client Socket. | |
void | run () |
Run method. | |
void | mainServer () |
Main output function. | |
Static Public Member Functions | |
void | main (String args[]) |
Test case. | |
Protected Member Functions | |
void | openConnection () |
Initializes a connection. | |
void | setPrintWriter () |
Initializes a PrintWriter. | |
void | closeConnection () |
Close connection. | |
void | normalizeAndPrint (String s, boolean isAttValue) |
Normalizes and prints the given string. | |
void | normalizeAndPrint (char[] ch, int offset, int length, boolean isAttValue) |
Normalizes and prints the given array of characters. | |
void | normalizeAndPrint (char c, boolean isAttValue) |
Normalizes and prints the given character. | |
Protected Attributes | |
int | port = 8080 |
Specifies the port to allow connections on. | |
ServerSocket | serverSocket |
The ServerSocket that accepts incoming connections to the server. | |
Socket | clientSocket |
The client socket. | |
OutputStream | networkOutputStream |
Output stream for the network socket (going from Server to Client). | |
InputStream | networkInputStream |
Input stream for the network socket (going from Client to Server). | |
int | fElementDepth |
Element depth. | |
Locator | fLocator |
Document locator. | |
PrintWriter | sout |
Socket output writer. | |
Static Protected Attributes | |
final boolean | DEFAULT_CANONICAL = true |
Definition at line 14 of file BasicServer.java.
|
Default constructor. Starts a server without a socket. Definition at line 43 of file BasicServer.java. References riverrat.BasicServer.serverSocket, and riverrat.BasicServer.sout. Referenced by riverrat.BasicServer.main(). |
|
Constructor. Opens up a ServerSocket listening for connections on the specified port.
Definition at line 54 of file BasicServer.java. References riverrat.BasicServer.serverSocket, and riverrat.BasicServer.sout. |
|
Close connection.
Definition at line 103 of file BasicServer.java. References riverrat.BasicServer.clientSocket, riverrat.BasicServer.networkInputStream, riverrat.BasicServer.networkOutputStream, and riverrat.BasicServer.sout. Referenced by riverrat.BasicServer.run(). |
|
Error. Part of the ErrorHandler interface. Definition at line 226 of file BasicServer.java. |
|
Fatal Error. Part of the ErrorHandler interface. Definition at line 231 of file BasicServer.java. |
|
Test case. Opens up a server socket and listens for client connections. On connecting, looks for XML files in the path from which the server was launched and outputs them over the socket, parsing them on the fly and using the ContentHandler callbacks to output the data.
Reimplemented in riverrat.LiveServer, riverrat.testing.FakeServer, riverrat.testing.NMEAFakeServer, and riverrat.testing.XMLFakeServer. Definition at line 272 of file BasicServer.java. References riverrat.BasicServer.BasicServer(). |
|
Main output function. Override this function in different server types. Reimplemented in riverrat.testing.FakeServer, riverrat.testing.NMEAFakeServer, and riverrat.testing.XMLFakeServer. Definition at line 253 of file BasicServer.java. References riverrat.BasicServer.sout. Referenced by riverrat.BasicServer.run(). |
|
Initializes a connection. This is a blocking method, and does not allow execution to continue until a connection has been opened. Definition at line 68 of file BasicServer.java. References riverrat.BasicServer.clientSocket, riverrat.BasicServer.port, riverrat.BasicServer.serverSocket, and riverrat.BasicServer.setPrintWriter(). Referenced by riverrat.BasicServer.run(). |
|
Initializes a PrintWriter.
Definition at line 89 of file BasicServer.java. References riverrat.BasicServer.clientSocket, riverrat.BasicServer.networkInputStream, riverrat.BasicServer.networkOutputStream, and riverrat.BasicServer.sout. Referenced by riverrat.BasicServer.openConnection(), and riverrat.BasicServer.setSocket(). |
|
Warning. Part of the ErrorHandler interface. Definition at line 221 of file BasicServer.java. |
|
The client socket. Currently the server will only support 1 connection. Definition at line 22 of file BasicServer.java. Referenced by riverrat.BasicServer.closeConnection(), riverrat.BasicServer.openConnection(), riverrat.BasicServer.run(), riverrat.BasicServer.setPrintWriter(), and riverrat.BasicServer.setSocket(). |