|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
client.Client.CascadeInputOutputHandler
private final class Client.CascadeInputOutputHandler
Internal class used to communicate with the mix cascade. Makes sure
messages are sent synchronously (request and reply alternately).
Otherwise the cascade would drop this client. Synchronized with
Client
via sendBuffer
and receiveBuffer
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private boolean |
lastMessageWasDummy
Indicates if the last message, that was received from the cascade, was a dummy. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
private |
Client.CascadeInputOutputHandler()
Constructs a new CascadeInputOutputHandler and calls
start() . |
Method Summary | |
---|---|
private void |
closeConnection()
Releases connection to mix cascade. |
private void |
receiveReply()
Receives a message ( Reply ) from the mix cascade and
saves its payload in the receiveBuffer , from where it's
available for the user's InputStream . |
void |
run()
Communicates with the mix cascade. |
private void |
sendMixMessage()
Sends a message to the mix cascade. |
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 |
Field Detail |
---|
private boolean lastMessageWasDummy
receiveReply()
Constructor Detail |
---|
private Client.CascadeInputOutputHandler()
CascadeInputOutputHandler
and calls
start()
.
Method Detail |
---|
public void run()
Client
via
sendBuffer
and receiveBuffer
.
run
in interface java.lang.Runnable
run
in class java.lang.Thread
private void sendMixMessage()
sendBuffer
): ChannelEstablishMessage
, ChannelMessage
, ChannelReleaseMessage
or DummyMessage
(= ChannelMessage
without payload (=only
padding)). Blocks until message is sent.
private void receiveReply()
Reply
) from the mix cascade and
saves its payload in the receiveBuffer
, from where it's
available for the user's InputStream
. Blocks until
message is received and written to buffer.
private void closeConnection()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |