java.lang.Runnable
protected class TThreadedSelectorServer.SelectorThread extends AbstractNonblockingServer.AbstractSelectThread
selectInterestChanges, selector
Constructor | Description |
---|---|
SelectorThread() |
Set up the SelectorThread with an unbounded queue for incoming accepts.
|
SelectorThread(int maxPendingAccepts) |
Set up the SelectorThread with an bounded queue for incoming accepts.
|
SelectorThread(java.util.concurrent.BlockingQueue<TNonblockingTransport> acceptedQueue) |
Set up the SelectorThread with a specified queue for connections.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
addAcceptedConnection(TNonblockingTransport accepted) |
Hands off an accepted connection to be handled by this thread.
|
void |
run() |
The work loop.
|
cleanupSelectionKey, handleRead, handleWrite, processInterestChanges, requestSelectInterestChange, wakeupSelector
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
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, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public SelectorThread() throws java.io.IOException
java.io.IOException
- if a selector cannot be createdpublic SelectorThread(int maxPendingAccepts) throws java.io.IOException
java.io.IOException
- if a selector cannot be createdpublic SelectorThread(java.util.concurrent.BlockingQueue<TNonblockingTransport> acceptedQueue) throws java.io.IOException
acceptedQueue
- The BlockingQueue implementation for holding incoming accepted
connections.java.io.IOException
- if a selector cannot be created.public boolean addAcceptedConnection(TNonblockingTransport accepted)
accepted
- The connection that has been accepted.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread