public class TNonblockingServer extends TServer
Modifier and Type | Class and Description |
---|---|
static class |
TNonblockingServer.AbstractNonblockingServerArgs<T extends TNonblockingServer.AbstractNonblockingServerArgs<T>> |
static class |
TNonblockingServer.Args |
protected class |
TNonblockingServer.FrameBuffer
Class that implements a sort of state machine around the interaction with
a client and an invoker.
|
protected class |
TNonblockingServer.SelectThread
The thread that will be doing all the selecting, managing new connections
and those that still need to be read.
|
TServer.AbstractServerArgs<T extends TServer.AbstractServerArgs<T>>
inputProtocolFactory_, inputTransportFactory_, outputProtocolFactory_, outputTransportFactory_, processorFactory_, serverTransport_
Constructor and Description |
---|
TNonblockingServer(TNonblockingServer.AbstractNonblockingServerArgs args) |
Modifier and Type | Method and Description |
---|---|
boolean |
isStopped() |
protected void |
joinSelector()
Block until the selector exits.
|
protected boolean |
requestInvoke(TNonblockingServer.FrameBuffer frameBuffer)
Perform an invocation.
|
protected void |
requestSelectInterestChange(TNonblockingServer.FrameBuffer frameBuffer)
A FrameBuffer wants to change its selection preferences, but might not be
in the select thread.
|
void |
serve()
Begin accepting connections and processing invocations.
|
protected boolean |
startListening()
Have the server transport start accepting connections.
|
protected boolean |
startSelectorThread()
Start the selector thread running to deal with clients.
|
void |
stop()
Stop serving and shut everything down.
|
protected void |
stopListening()
Stop listening for conections.
|
isServing, setServing
public TNonblockingServer(TNonblockingServer.AbstractNonblockingServerArgs args)
public void serve()
protected boolean startListening()
protected void stopListening()
protected boolean startSelectorThread()
protected void joinSelector()
protected boolean requestInvoke(TNonblockingServer.FrameBuffer frameBuffer)
protected void requestSelectInterestChange(TNonblockingServer.FrameBuffer frameBuffer)
public boolean isStopped()