ContextType - Execution context type.public class Listener<ContextType extends ContextInterface> extends Thread implements IoServiceUtils.Configuration
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PACKET_LIMIT
Default packet size limit.
|
static int |
SLEEP_TICK
Sleep timeout.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
Listener(String name,
ContextType context,
Dispatcher<? super ContextType> dispatcher)
Initializes listener thread.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxPacketSize()
Returns size of maximum JSON-RPC packet size.
|
Listener<ContextType> |
release()
Sets shutdown flag.
|
void |
run()
Perform the thread loop.
|
void |
setAddress(InetSocketAddress address)
Sets listening interface.
|
void |
setMaxPacketSize(int maxPacketSize)
Sets max JSON-RPC packet size.
|
void |
setSleepTick(int sleepTick)
Sets sleep interval.
|
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, yieldpublic static final int SLEEP_TICK
public static final int DEFAULT_PACKET_LIMIT
public Listener(String name, ContextType context, Dispatcher<? super ContextType> dispatcher)
name - Thread title.context - API context.dispatcher - JSON-RPC dispatcher.public void setSleepTick(int sleepTick)
sleepTick - Sleep interval (in miliseconds).public void setAddress(InetSocketAddress address)
address - Listening address.public void setMaxPacketSize(int maxPacketSize)
maxPacketSize - Packet size in bytes.public int getMaxPacketSize()
getMaxPacketSize in interface IoServiceUtils.Configurationpublic Listener<ContextType> release()
Copyright © 2015 RafaĆ Wrzeszcz - Wrzasq.pl. All rights reserved.