|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
simnet.Application
submission.Demo.EchoClient
submission.Demo.UDPEchoClient
An example of an EchoClient implemented with UDP.
| Field Summary | |
protected boolean |
keep_going
|
protected DatagramSocket |
sock
|
| Fields inherited from class submission.Demo.EchoClient |
defaultPort |
| Fields inherited from class simnet.Application |
appid, appstart, node, NODE_ID, pid, random, sim |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
UDPEchoClient()
|
|
| Method Summary | |
void |
customInit()
Create a new datagram socket and bind it to any local port. |
void |
echo(java.lang.Integer host,
java.lang.Integer port,
java.lang.String msg)
|
void |
echo(java.lang.Integer host,
java.lang.String msg)
|
void |
echo(int host,
int port,
java.lang.String msg)
|
void |
echo(int host,
java.lang.String msg)
|
void |
echo(java.lang.String host,
java.lang.Integer port,
java.lang.String msg)
|
void |
echo(java.lang.String host,
java.lang.String msg)
Send a message over the connection |
boolean |
prePlugout(java.lang.Object replacement)
Tell our thread we are done, and close the socket if we are not being replaced. |
void |
run()
Wait for messages to be received, and print them out. |
void |
status()
Print a status of connection |
| Methods inherited from class simnet.Application |
closeWindow, finalize, getTitleString, initialize, plugoutNotification, printout, printout, processWindowCommand, rawOut, window |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected DatagramSocket sock
protected transient boolean keep_going
| Constructor Detail |
public UDPEchoClient()
| Method Detail |
public void customInit()
customInit in class Application
public void echo(java.lang.String host,
java.lang.String msg)
public void echo(java.lang.Integer host,
java.lang.String msg)
public void echo(int host,
int port,
java.lang.String msg)
public void echo(java.lang.String host,
java.lang.Integer port,
java.lang.String msg)
public void echo(java.lang.Integer host,
java.lang.Integer port,
java.lang.String msg)
public void echo(int host,
java.lang.String msg)
public void run()
run in interface java.lang.Runnablerun in class Applicationpublic void status()
public boolean prePlugout(java.lang.Object replacement)
prePlugout in interface Pluggable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||