Netty–file programming

3. File programming 3.1 FileChannel FileChannel working mode FileChannel can only work in blocking mode Get FileChannel cannot be opened directly. FileChannel must be obtained through FileInputStream, FileOutputStream or RandomAccessFile. They all have getChannel methods. The channel obtained through FileInputStream can only be read The channel obtained through FileOutputStream can only be written Whether it […]

2.Netty simple application

Introduce Maven dependencies <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>4.1.49.Final</version> </dependency> Server-side pipeline processor public class NettyServerHandler extends ChannelInboundHandlerAdapter {<!– –> //Read the actual data (here we can read the message sent by the client) /* 1. ChannelHandlerContext ctx: context object, containing pipeline, channel channel, address 2. Object msg: It is the data sent by the client. The […]

OkayToCloseProcedure of Windows ObjectType Hook

1. Background Object Type Hook is an in-depth Hook based on Object Type, which is more in-depth than the commonly used SSDT Hook. For the analysis of Object Type, please see the article “Windows Driver Development Learning Record-ObjectType Hook’s ObjectType Structure Related Analysis”. The Hook used here is one of OkayToCloseProcedure. The article implements filtering […]

OpenProcedure of Windows ObjectType Hook

1. Background Object Type Hook is an in-depth Hook based on Object Type, which is more in-depth than the commonly used SSDT Hook. For the analysis of Object Type, please see the article “Windows Driver Development Learning Record-ObjectType Hook’s ObjectType Structure Related Analysis”. The Hook used here is one of the OpenProcedures. The article is […]

Netty’s IO Principle 2

The concept of zero copy requires context, such as DCI (Data Context Interaction) in DDD. Using Scala’s Trait, Human can inherit SchoolTeacherRole or SchoolStudentRole, etc., so that Human has the traits of the role and automatically blocks traits other than this role. If the boundary is transferred to the JVM memory area, it is the […]

Netty event loop group principle five

Executor Executor is an interface that is responsible for executing tasks (Runnable objects) submitted to it. This interface can decouple “task submission” and “task execution”. That is, someone only needs to submit the task to the Executor, and you don’t have to worry about how it allocates threads to the task for execution. However, the […]

Netty’s IO principle three

Recycling conditions for off-heap memory: Buffer underlying principle: Direct memory and heap memory source code implementation: //The base class of Buffer, which defines the usage of four index subscripts public abstract class Buffer { // Invariant properties: mark <= position <= limit <= capacity private int mark = -1; // Mark index subscript private int […]

Netty’s overall concept analysis four

Why doesn’t ServerSocketChannel here use ServerSocket? Selector: How to execute asynchronously? 1.Future interface 2. Get the task execution results through Future Disadvantages of Future: When using Future to obtain asynchronous execution results, you must either call the blocking method get() or poll to see if isDone() is true. Both methods are not very good because […]

Netty+SpringBoot creates a TCP long connection communication solution

The path to growth as a programmer Internet/Programmer/Technology/Data Sharing focus on This article should take approximately 12 minutes to read. From: blog.csdn.net/u013615903/article/details/129044283 Background of the project text 1. Project structure 2. Project module 3. Business process 4. Detailed explanation of code 5. Test 6. Source code postscript Project background Recently, an Internet of Things project […]

Netty’s IO principle one

Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients. Netty features: 1. Asynchronous event-driven (asynchronous event-driven) 2. Maintainability (maintainable) 3. Construction of high-performance protocol servers & clients (high performance protocol servers & clients) 4. The three highs of the Internet: high availability, high performance, and […]