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) class
ClientRxHandler.ClientTxHandler
-
Field Summary
Fields Modifier and Type Field Description (package private) java.net.Socket
clientSocket
(package private) java.io.BufferedReader
inStream
(package private) java.lang.String
inString
(package private) DCCppMessage
lastSentMessage
(package private) java.io.OutputStream
outStream
(package private) java.lang.String
remoteAddress
(package private) java.util.LinkedList<DCCppReply>
replyQueue
(package private) java.lang.Thread
txThread
(package private) boolean
useOldPrefix
-
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 void
close()
void
message(DCCppMessage msg)
Member function that will be invoked by a DCCppInterface implementation to forward a DCC++ message sent to the layout.void
message(DCCppReply msg)
Member function that will be invoked by a DCCppInterface implementation to forward a DCC++ message from the layout.void
notifyTimeout(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.void
run()
-
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:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
close
public void close()
-
message
public void message(DCCppMessage msg)
Description copied from interface:DCCppListener
Member 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:
message
in 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:DCCppListener
Member function that will be invoked by a DCCppInterface implementation to forward a DCC++ message from the layout.- Specified by:
message
in 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:DCCppListener
Member function invoked by an DCCppInterface implementation to notify a sender that an outgoing message timed out and was dropped from the queue.- Specified by:
notifyTimeout
in interfaceDCCppListener
- Parameters:
m
- the message that timed out.
-
-