Async Server

Asynchronous server application is not suspended while it waits for a connection from a client. If we spin up threads for each session, then the server waits for the IO operations which we don’t want. This example project shows handling tcp sockets Asynchronously without running separate threads for each session.

The example async socket server is available on github.

Getting Started

Requirements

  • Java 8
  • Maven

Project Setup

1. Clone Repository

2. Build Project

3. Spin-Up Server

4. Finish

We can spin up multiple concurrent sessions with telnet. Our server will be pushing back to same data that we sent.

Project repository.

That was a quick one. So hope I will come back and explain the code in the repository more detailed.