NOTE
Asynchronous Java Server
A completion-driven server design using asynchronous accept/read/write operations and explicit connection state.
This is a historical learning note and may contain outdated or incomplete understanding.
An asynchronous server accepts connections with AsynchronousServerSocketChannel and continues work from completion callbacks or futures.
A robust connection state machine must handle partial reads/writes, framing, disconnects, timeout/cancellation, buffer ownership, and concurrent callbacks. One callback is not necessarily one whole application message.
Re-issue accept after each accepted connection so the server continues listening. Keep expensive CPU/business work away from completion machinery when it can delay I/O progress, and enforce bounded downstream concurrency rather than accepting unlimited work.