|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
workspace.NetworkConnection
public class NetworkConnection
This class encapsulates the connections to another host. All events received are passed on to a queue, which another thread is expected to process.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
NetworkConnection(NetworkManager manager,
java.lang.Long id,
java.net.Socket s,
java.util.Queue<NetworkEvent> q)
|
Method Summary | |
---|---|
void |
close()
Close the streams and the socket. |
java.lang.String |
getHostAddress()
|
int |
getPort()
|
void |
run()
Continually read from the input stream. |
java.lang.String |
toString()
|
void |
write(NetworkEvent event)
Write to the output stream. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NetworkConnection(NetworkManager manager, java.lang.Long id, java.net.Socket s, java.util.Queue<NetworkEvent> q) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void write(NetworkEvent event) throws java.io.IOException
java.io.IOException
public void close()
public java.lang.String getHostAddress()
public int getPort()
public java.lang.String toString()
toString
in class java.lang.Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |