Java IO, NIO and Netty network programming

1. Introduction to IO, NIO and Netty1.1 blocking I / O Synchronous blocking I/O mode: when a thread executes the read() or write() method, the thread will block until it reads some data or writes out all the data. During this period, the thread cannot do anything else. When the number of active connections is not particularly high (less than 10 ...

Added by callie212 on Sat, 11 Dec 2021 11:43:25 +0200

NioEventLoop source code analysis

In previous installments, we analyzed the service startup, client connection and client message processing processes of Netty. In this installment, we will explain an extremely important component of Netty, event loop. NioEventLoopGroup analysis When we usually use Netty, we usually operate with NioEventLoopGroup, so we start with NioEventLoo ...

Added by Dragoa on Wed, 01 Dec 2021 19:49:00 +0200

Thread pool learning 5

8. Tools for sharing models 8.1 thread pool Compared with pooling technology, it is common. Thread pool, database connection pool, Http connection pool and so on are all applications of this idea. The idea of pooling technology is mainly to reduce the consumption of resources and improve the utilization of resources. Thread pools provid ...

Added by Chris16962 on Wed, 01 Dec 2021 04:28:21 +0200

Implementing simple RPC framework 9 from scratch: heartbeat and reconnection mechanism of network communication

1, Heartbeat What is heartbeat In TPC, after the client and server establish a connection, they need to send data packets regularly to inform each other that they are still online to ensure the effectiveness of the TPC connection. If a connection has no heartbeat for a long time, it needs to be disconnected in time, otherwise the server will ...

Added by nobertos on Wed, 24 Nov 2021 11:32:12 +0200

Detailed explanation of Reactor thread model for Netty source code analysis

Last article , we analyzed the initialization process of Netty server startup. Today, let's analyze the Reactor thread model in Netty Before analyzing the source code, let's analyze where EventLoop is used? Connection listening registration of NioServerSocketChannel IO event registration for NioSocketChannel NioServerSocketChannel connection ...

Added by the DtTvB on Mon, 22 Nov 2021 05:17:41 +0200

yyds network programming Netty

1. Introduction to Netty 1.1. Netty is a client server framework based on Java NIO. Using netty, you can quickly develop network applications. Netty provides a high-level abstraction to simplify the programming of TCP and UDP servers, but you can still use the underlying API. 1.2. The internal implementation of netty is very complex, but nett ...

Added by demophoon88 on Tue, 02 Nov 2021 18:49:31 +0200

"Netty Source 1" Introducing Network IO

Channel IO Operations Link, where a Channel represents an open connection to an entity. In network IO, it is usually used to read/write data with Buffer. Implementations of some of the major Channel s in JAVA NIO FileChannel: Read and write data from a file.DatagramChannel: Can read and write data in the network through UDP.SocketChannel: ...

Added by ('(' on Sun, 24 Oct 2021 19:39:57 +0300

Source code analysis of EventLoop and EventLoopGroup of Netty core components

2021SC@SDUSC In this blog, we will focus on the core components of netty, EventLoop and EventLoopGroup. catalogue 1, Introduction example 2, Analysis 1. Relationship between nioeventloop and NioEventLoopGroup 2. Constructor of nioeventloop 3. newChild function in nioeventloopgroup I   Introduction example Netty provides a large ...

Added by sandy1028 on Fri, 15 Oct 2021 20:17:22 +0300

Graphic io+BIO+NIO+AIO+Netty + chat room practice

The beginning of 2020 is extraordinary. I will stay at home and study io again io is divided into bio,nio,aio Among them, netty belongs to nio, and aio has not been widely used, so it has great potential in the future Understand several concepts Synchronous and asynchronous Blocking and non blockingio m ...

Added by PW on Wed, 10 Jun 2020 06:42:48 +0300

Implement simple chat function 1 to 1 based on netty (private message / group sending)

netty chat explain: My thoughts demonstration Chat server Chat initialization configuration Client processing message Front end code epilogue explain: I found that it takes a lot of energy to write a blog. In order to leave more time for promotion, I just post the code. Learning address: https: ...

Added by toppac on Sun, 07 Jun 2020 07:35:12 +0300