com.quadcap.net.server |
A tuned multi-threaded server architecture. Allocations are minimized
through reusable objects:
Worker , WorkerInputStream ,
WorkerOutputStream .
|
Java Source File Name | Type | Comment |
Acceptor.java | Class | Implements the main socket listening thread: we first obtain a block
of idle workers (currently 4, should be configurable though.)
then accept connections and pass them out until we need more workers. |
EchoWorker.java | Class | For testing, a worker that simulates an HTTP server. |
Server.java | Class | A server has a set of workers, a context, and an acceptor. |
SimpleWorker.java | Class | A simple worker for testing. |
Test.java | Class | Package level testing. |
Worker.java | Class | A worker is a runnable with a context, in/out streams, and (when active)
a socket. |
WorkerInputStream.java | Class | An efficient worker input stream, which supports recycling. |
WorkerOutputStream.java | Class | An efficient worker output stream, which is NOT destroyed after
each session, to reduce allocation overhead. |