Package wappsto.iot.ssl
Class InputReader
- java.lang.Object
-
- java.lang.Thread
-
- wappsto.iot.ssl.InputReader
-
- All Implemented Interfaces:
java.lang.Runnable
public class InputReader extends java.lang.ThreadReads incoming data from the SSL socket and parses them into distinct strings
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MESSAGE_TIMOUT
-
Constructor Summary
Constructors Constructor Description InputReader(java.io.InputStream incomingData, Callback messageCallback, Callback errorCallback)Instantiate the reader with the default timeoutInputReader(java.io.InputStream incomingData, Callback messageCallback, Callback errorCallback, int timeout)Instantiate the reader with a defined timeout
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()Start the thread-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
-
DEFAULT_MESSAGE_TIMOUT
public static final int DEFAULT_MESSAGE_TIMOUT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InputReader
public InputReader(java.io.InputStream incomingData, Callback messageCallback, Callback errorCallback)Instantiate the reader with the default timeout- Parameters:
incomingData- stream of incoming data from the socketmessageCallback- method to call on a completed messageerrorCallback- method to call if an incoming message is malformed
-
InputReader
public InputReader(java.io.InputStream incomingData, Callback messageCallback, Callback errorCallback, int timeout)Instantiate the reader with a defined timeout- Parameters:
incomingData- stream of incoming data from the socketmessageCallback- method to call on a completed messageerrorCallback- method to call if an incoming message is malformedtimeout- timeout from receiving the start of a message before the message is deemed malformed
-
-