Package com.neovisionaries.ws.client
Class WritingThread
java.lang.Object
java.lang.Thread
com.neovisionaries.ws.client.WebSocketThread
com.neovisionaries.ws.client.WritingThread
- All Implemented Interfaces:
Runnable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private WebSocketFrame
private boolean
private final LinkedList
<WebSocketFrame> private final PerMessageCompressionExtension
private boolean
private boolean
private static final int
private static final int
private static final int
private static final int
Fields inherited from class com.neovisionaries.ws.client.WebSocketThread
mWebSocket
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
private void
doFlush()
private void
flush()
private long
flushIfLongInterval
(long lastFlushAt) private void
private boolean
isFlushNeeded
(boolean last) private static boolean
private void
main()
private void
void
boolean
queueFrame
(WebSocketFrame frame) void
void
runMain()
private void
sendFrame
(WebSocketFrame frame) private void
sendFrames
(boolean last) private int
Methods inherited from class com.neovisionaries.ws.client.WebSocketThread
callOnThreadCreated, run
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
-
Field Details
-
SHOULD_SEND
private static final int SHOULD_SEND- See Also:
-
SHOULD_STOP
private static final int SHOULD_STOP- See Also:
-
SHOULD_CONTINUE
private static final int SHOULD_CONTINUE- See Also:
-
SHOULD_FLUSH
private static final int SHOULD_FLUSH- See Also:
-
FLUSH_THRESHOLD
private static final int FLUSH_THRESHOLD- See Also:
-
mFrames
-
mPMCE
-
mStopRequested
private boolean mStopRequested -
mCloseFrame
-
mFlushNeeded
private boolean mFlushNeeded -
mStopped
private boolean mStopped
-
-
Constructor Details
-
WritingThread
-
-
Method Details
-
runMain
public void runMain()- Specified by:
runMain
in classWebSocketThread
-
main
private void main() -
requestStop
public void requestStop() -
queueFrame
-
isHighPriorityFrame
-
addHighPriorityFrame
-
queueFlush
public void queueFlush() -
flushIgnoreError
private void flushIgnoreError() -
flush
- Throws:
IOException
-
waitForFrames
private int waitForFrames() -
sendFrames
- Throws:
WebSocketException
-
isFlushNeeded
private boolean isFlushNeeded(boolean last) -
flushIfLongInterval
- Throws:
WebSocketException
-
doFlush
- Throws:
WebSocketException
-
sendFrame
- Throws:
WebSocketException
-
changeToClosing
private void changeToClosing() -
notifyFinished
private void notifyFinished()
-