Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 5 days ago
JSON representation
The Implementation of Blocking IO, Non-blocking IO and Netty
- Host: GitHub
- URL: https://github.com/zinaaan/io-implementation
- Owner: Zinaaan
- Created: 2023-06-18T22:10:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-30T01:24:46.000Z (about 1 year ago)
- Last Synced: 2024-10-10T11:43:26.678Z (26 days ago)
- Topics: blockingsockets, input-output, java, netty, nonblocking-sockets
- Language: Java
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.