|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--edu.UCL.xmiddle.framework.controller.Network
|
+--edu.UCL.xmiddle.controller.UDPNetwork
| Field Summary | |
static java.lang.String |
IP
|
static int |
MAX_SEGMENT
|
static int |
PORT
|
int |
PRIVATE_PORT
|
| Fields inherited from class edu.UCL.xmiddle.framework.controller.Network |
activeSessions, caller, CONNECTED, DISCONNECTED, localhost, locator, status |
| Constructor Summary | |
UDPNetwork(LocalHost localhost,
Manager manager)
Creates a new UDPNetwork instance. |
|
| Method Summary | |
boolean |
connect()
Connects to the network |
Listener |
createListener(Host host,
java.lang.Object sessionID)
Returns a listener to the given host for the given protocol session. |
Sender |
createSender(Host host,
java.lang.Object sessionID)
Not implemented (see createListener) |
void |
disconnect()
Immediatly disconnects from the network, killing all protocols and acknowledgers that are running |
void |
exit()
Signifies that we are about to exit |
java.net.MulticastSocket |
getConnection()
Returns the multicast socket used to communicate with the xmiddle group |
void |
registerSession(ProtocolChooser session)
Registers a new protocol session |
void |
removeSession(java.lang.Object sessionID)
Removes a protocol session |
void |
run()
receives messages sent and queues them to be processed by the message queue processor |
boolean |
send(Data data)
Sends data to a remote host |
| Methods inherited from class edu.UCL.xmiddle.framework.controller.Network |
getStatus, setLocator |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public int PRIVATE_PORT
public static final int PORT
public static final java.lang.String IP
public static int MAX_SEGMENT
| Constructor Detail |
public UDPNetwork(LocalHost localhost,
Manager manager)
UDPNetwork instance.
localhost - a reference to the localhost so that we can
queue requestsmanager - not used currently (can be null)| Method Detail |
public void run()
run in interface java.lang.Runnablerun in class Networkpublic java.net.MulticastSocket getConnection()
MulticastSocket valuepublic boolean connect()
connect in class Networkpublic void disconnect()
disconnect in class Networkpublic void exit()
exit in class Networkpublic boolean send(Data data)
send in class Networkdata - a Data value
boolean value
public Sender createSender(Host host,
java.lang.Object sessionID)
createSender in class Networkhost - a Host valuesessionID - an Object value
Sender value
public Listener createListener(Host host,
java.lang.Object sessionID)
createListener in class Networkhost - the remote hostsessionID - The id of the session for which this listener
is being created
Listener value
public void removeSession(java.lang.Object sessionID)
throws InvalidSessionIDException
removeSession in class NetworksessionID - The session ID
InvalidSessionIDException - if the session was not registered
public void registerSession(ProtocolChooser session)
throws ExistingSessionIDException
registerSession in class Networksession - a ProtocolChooser value
ExistingSessionIDException - if a session with the
same ID has been registered
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||