Engineered for high concurrency with non-blocking I/O multiplexing (`Selector`), event-driven dispatchers, zero-copy Direct ByteBuffers, and multi-port socket binding.
Watch the `java.nio.channels.Selector` thread process non-blocking `OP_ACCEPT`, `OP_READ`, and `OP_WRITE` key events across multiple socket channels concurrently.
Active ServerSockets
8080
ServerSocketChannel #1
HTTP/1.1 Public API
OP_ACCEPT
8443
ServerSocketChannel #2
Admin Metrics & Control
OP_ACCEPT
8081
ServerSocketChannel #3
WebSocket Event Stream
OP_ACCEPT
NIO Reactor Thread
selector.select()
Status: WAITING_FOR_KEYS
Registered Channels: 3 Listeners
Active Selection Keys: 0
Buffer Allocation: DirectByteBuffer (16KB)
Selector Event Log
[NIO-LOOP] Selector initialized with 3 ServerSocketChannels registered.
[REGISTER] Channel :8080 registered for OP_ACCEPT
[REGISTER] Channel :8443 registered for OP_ACCEPT
[REGISTER] Channel :8081 registered for OP_ACCEPT
Performance & Throughput Benchmarks
Benchmarked on Linux x86_64, 16 Cores, JDK 17, 10,000 Concurrent Connections using `wrk -t8 -c10000 -d30s`.
Dispatch raw HTTP requests into the simulated Java NIO event loop. The router matches routes and returns valid HTTP response headers and payloads.
Quick Presets:
Raw HTTP/1.1 Response FrameLatency: -- ms
Ready to dispatch HTTP/1.1 request into non-blocking Selector channel...
// System Blueprint
Designed for Ultra-Low Latency I/O
Non-Blocking Selector Loop
Uses Java's `Selector` and `SocketChannel` in non-blocking mode. A single thread effortlessly monitors thousands of open sockets for ready I/O operations.
Multi-Port Bindings
Bind multiple `ServerSocketChannel` instances to different TCP ports (e.g., HTTP, Admin, WebSockets) managed seamlessly by a single Selector instance.
Direct ByteBuffers
Allocates off-heap `ByteBuffer.allocateDirect()` for zero-copy I/O passing data directly between OS socket buffers and Java channels without GC impact.
Event-Driven Router
Fast Radix-tree URL matcher dispatches HTTP requests to non-blocking handlers or offloads heavy tasks to worker thread pools.