|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.jme3.network.base.ConnectorAdapter
public class ConnectorAdapter
Wraps a single Connector and forwards new messages to the supplied message dispatcher. This is used by DefaultClient to manage its connector objects. This is only responsible for message reading and provides no support for buffering writes.
This adapter assumes a simple protocol where two bytes define a (short) object size with the object data to follow. Note: this limits the size of serialized objects to 32676 bytes... even though, for example, datagram packets can hold twice that. :P
Nested Class Summary | |
---|---|
protected class |
ConnectorAdapter.WriterThread
|
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 | |
---|---|
ConnectorAdapter(Connector connector,
MessageListener<java.lang.Object> dispatcher,
ErrorListener<java.lang.Object> errorHandler,
boolean reliable)
|
Method Summary | |
---|---|
void |
close()
|
protected void |
dispatch(Message m)
|
protected void |
handleError(java.lang.Exception e)
|
void |
run()
|
void |
write(java.nio.ByteBuffer data)
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, 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 |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConnectorAdapter(Connector connector, MessageListener<java.lang.Object> dispatcher, ErrorListener<java.lang.Object> errorHandler, boolean reliable)
Method Detail |
---|
public void close()
protected void dispatch(Message m)
public void write(java.nio.ByteBuffer data)
protected void handleError(java.lang.Exception e)
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 |