Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zinaaan/io-implementation

The Implementation of Blocking IO, Non-blocking IO and Netty
https://github.com/zinaaan/io-implementation

blockingsockets input-output java netty nonblocking-sockets

Last synced: 8 days ago
JSON representation

The Implementation of Blocking IO, Non-blocking IO and Netty

Awesome Lists containing this project

README

        

# io-implementation
The Implementation of Blocking IO, Non-blocking IO and Netty
## BIO-V1
![image](https://github.com/Zinaaan/io-implementation/assets/39329676/39781b8d-e7db-43c0-aad7-7b449381d93a)

The server only use one thread to receive and handle client sockets. If current socket is still in processing, the subsequent socket will be blocked.

## BIO-V2
### New-1:
The server will open a separate thread to process each new socket so that the multiple socket could process concurrently.
### New-2:
The server will create a thread pool to reduce the overhead of thread creation and destruction.

## NIO-V1
Add each socket events to array, and continuously loop to check and process it even if this socket didn't send any message

## NIO-V2
Initialize a Selector to receive the socket events. The selector will start processing only when there are some socket registered.