|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectroomba.roombanetwork.server.RoombaNetworkServer
public class RoombaNetworkServer
This class performs the role of RNS (Roomba Network Server). It handles connections from RNCs and routes messages appropriately.
| Field Summary | |
|---|---|
static java.lang.String |
PROTOCOL_VERSION
The Protocol version that the server is using |
| Constructor Summary | |
|---|---|
RoombaNetworkServer(int port)
Constructor for creating the RNS. |
|
| Method Summary | |
|---|---|
void |
disconnectClient(int id)
Called when a connection to a client should be disconnected. |
void |
establishClient(int id,
java.lang.String host,
int port)
Called when a connection to a client should be established. |
RNCTable |
getRNCTable()
Accessor to the RNC Table |
static void |
main(java.lang.String[] args)
The main method to start the RNS. |
void |
messageReceived(java.lang.String message)
Called when an incoming message is received. |
void |
sendMessage(int receiverId,
java.lang.String message)
Called when an outgoing message should be sent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROTOCOL_VERSION
| Constructor Detail |
|---|
public RoombaNetworkServer(int port)
port - The port number that the server should operate on| Method Detail |
|---|
public void messageReceived(java.lang.String message)
messageReceived in interface SocketListenermessage - The message that has been received
public void establishClient(int id,
java.lang.String host,
int port)
id - The client's IDhost - The client's hostport - The client's portpublic void disconnectClient(int id)
id - The client's IDpublic RNCTable getRNCTable()
public void sendMessage(int receiverId,
java.lang.String message)
receiverId - The receiver client's IDmessage - The message to sendpublic static void main(java.lang.String[] args)
args - The args should include 1 argument (optional), which is the port
that the RNS should listen on. If the port is not provided, the default port
of 7777 will be used.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||