|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
commandNetworking.MessageListenerThread
public class MessageListenerThread
This thread represents a thread who's only function is to listen for messages from the server A message is received by first reading the length of the package, then reading that number of bytes from the stream Listening intervals are hardcoded at 30ms.
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 | |
---|---|
MessageListenerThread(Communicator com)
A simple constructor that assigns a communicator to the thread, index is set to zero |
|
MessageListenerThread(Communicator com,
int index)
Another simple constructor, this also sets a given index |
Method Summary | |
---|---|
static Packet |
DeserializeObject(byte[] byteArray)
Decode an object and return it |
void |
run()
Overwrites the run method in Thread. |
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, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MessageListenerThread(Communicator com)
com
- public MessageListenerThread(Communicator com, int index)
com
- index
- Method Detail |
---|
public static Packet DeserializeObject(byte[] byteArray)
byteArray
-
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |