Package jmri.jmrix.dccpp.dccppovertcp
Class ClientRxHandler
- java.lang.Object
-
- java.lang.Thread
-
- jmri.jmrix.dccpp.dccppovertcp.ClientRxHandler
-
- All Implemented Interfaces:
java.lang.Runnable,java.util.EventListener,AbstractMRListener,DCCppListener
public final class ClientRxHandler extends java.lang.Thread implements DCCppListener
Implementation of the DCCppOverTcp LbServer Server Protocol.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classClientRxHandler.ClientTxHandler
-
Field Summary
Fields Modifier and Type Field Description (package private) java.net.SocketclientSocket(package private) java.io.BufferedReaderinStream(package private) java.lang.StringinString(package private) DCCppMessagelastSentMessage(package private) java.io.OutputStreamoutStream(package private) java.lang.StringremoteAddress(package private) java.util.LinkedList<DCCppReply>replyQueue(package private) java.lang.ThreadtxThread(package private) booleanuseOldPrefix
-
Constructor Summary
Constructors Constructor Description ClientRxHandler(java.lang.String newRemoteAddress, java.net.Socket newSocket)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidmessage(DCCppMessage msg)Member function that will be invoked by a DCCppInterface implementation to forward a DCC++ message sent to the layout.voidmessage(DCCppReply msg)Member function that will be invoked by a DCCppInterface implementation to forward a DCC++ message from the layout.voidnotifyTimeout(DCCppMessage m)Member function invoked by an DCCppInterface implementation to notify a sender that an outgoing message timed out and was dropped from the queue.voidrun()-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
clientSocket
java.net.Socket clientSocket
-
inStream
java.io.BufferedReader inStream
-
outStream
java.io.OutputStream outStream
-
replyQueue
final java.util.LinkedList<DCCppReply> replyQueue
-
txThread
java.lang.Thread txThread
-
inString
java.lang.String inString
-
remoteAddress
java.lang.String remoteAddress
-
lastSentMessage
DCCppMessage lastSentMessage
-
useOldPrefix
boolean useOldPrefix
-
-
Constructor Detail
-
ClientRxHandler
public ClientRxHandler(java.lang.String newRemoteAddress, java.net.Socket newSocket)
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
close
public void close()
-
message
public void message(DCCppMessage msg)
Description copied from interface:DCCppListenerMember function that will be invoked by a DCCppInterface implementation to forward a DCC++ message sent to the layout. Normally, this function will do nothing.- Specified by:
messagein interfaceDCCppListener- Parameters:
msg- The received DCC++ message. Note that this same object may be presented to multiple users. It should not be modified here.
-
message
public void message(DCCppReply msg)
Description copied from interface:DCCppListenerMember function that will be invoked by a DCCppInterface implementation to forward a DCC++ message from the layout.- Specified by:
messagein interfaceDCCppListener- Parameters:
msg- The received DCC++ message. Note that this same object may be presented to multiple users. It should not be modified here.
-
notifyTimeout
public void notifyTimeout(DCCppMessage m)
Description copied from interface:DCCppListenerMember function invoked by an DCCppInterface implementation to notify a sender that an outgoing message timed out and was dropped from the queue.- Specified by:
notifyTimeoutin interfaceDCCppListener- Parameters:
m- the message that timed out.
-
-