public class NioSelectorScheduler
extends java.lang.Object
listen(int, Class, Scheduler)) as the number of new http connections. The supplied scheduler is used to
execute the tasks. It is possible, although not typical, to run tasks in the NioSelectorScheduler itself, as it too
is a scheduler.
Usage is as follows:
NioSelectorScheduler nss = new NioSelectorScheduler();
nss.listen(8080, MySessionTask.class, Scheduler.getDefaultScheduler();
class MySessionTask extends SessionTask {
...
}
SessionTask| Modifier and Type | Class and Description |
|---|---|
class |
NioSelectorScheduler.RegistrationTask |
static interface |
NioSelectorScheduler.SessionFactory |
| Modifier and Type | Field and Description |
|---|---|
static int |
LISTEN_BACKLOG |
| Constructor and Description |
|---|
NioSelectorScheduler() |
| Modifier and Type | Method and Description |
|---|---|
int |
listen(int port,
java.lang.Class<? extends SessionTask> sockTaskClass,
Scheduler sockTaskScheduler) |
int |
listen(int port,
NioSelectorScheduler.SessionFactory factory,
Scheduler sockTaskScheduler) |
void |
shutdown() |
public NioSelectorScheduler()
throws java.io.IOException
java.io.IOExceptionpublic int listen(int port,
NioSelectorScheduler.SessionFactory factory,
Scheduler sockTaskScheduler)
throws java.io.IOException
java.io.IOExceptionpublic int listen(int port,
java.lang.Class<? extends SessionTask> sockTaskClass,
Scheduler sockTaskScheduler)
throws java.io.IOException
java.io.IOExceptionpublic void shutdown()