|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
simnet.Application
simnet.TCPPingPongClient
| Nested Class Summary | |
private class |
TCPPingPongClient.EchoThread
|
| Field Summary | |
protected int |
defaultPort
|
protected boolean |
first
|
protected Socket |
sock
|
| Fields inherited from class simnet.Application |
appid, appstart, frame, initialized, node, NODE_ID, pid, random, sim, win |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
TCPPingPongClient()
|
|
| Method Summary | |
void |
close()
Close the connection if it is currently open. |
void |
connect(int host)
Connect to the specified host on the default port. |
void |
connect(java.lang.Integer host)
|
void |
connect(java.lang.Integer host,
java.lang.Integer port)
|
void |
connect(int host,
int port)
|
void |
connect(java.lang.String host)
Connect to an echo server. |
void |
connect(java.lang.String host,
java.lang.Integer port)
|
void |
customInit()
This is where an application can do any application-specific initializeation it requires. |
void |
echo(java.lang.Integer times,
java.lang.Integer randRange)
Send a message across the connection. |
void |
echo(int times,
int randRange)
|
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 Socket sock
protected boolean first
protected int defaultPort
| Constructor Detail |
public TCPPingPongClient()
| Method Detail |
public void customInit()
Application
customInit in class Applicationpublic void connect(java.lang.String host)
public void connect(java.lang.Integer host)
public void connect(java.lang.String host,
java.lang.Integer port)
public void connect(java.lang.Integer host,
java.lang.Integer port)
public void connect(int host,
int port)
public void connect(int host)
public void run()
run in interface java.lang.Runnablerun in class Applicationpublic void close()
public void echo(java.lang.Integer times,
java.lang.Integer randRange)
public void echo(int times,
int randRange)
public 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 | |||||||||