Multi-thread message processing method based on netty framework
The invention provides a multi-thread message processing method based on a netty framework, which relates to the technical field of computer information processing, and comprises the following steps: creating an event loop group to construct a thread pool, creating an udp starting class, binding a u...
Gespeichert in:
Hauptverfasser: | , , , |
---|---|
Format: | Patent |
Sprache: | chi ; eng |
Schlagworte: | |
Online-Zugang: | Volltext bestellen |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | The invention provides a multi-thread message processing method based on a netty framework, which relates to the technical field of computer information processing, and comprises the following steps: creating an event loop group to construct a thread pool, creating an udp starting class, binding a user-defined processing class, associating a specified port to monitor, and realizing a loop algorithm for the event loop group in the user-defined processing class. And executing message analysis in a mode of polling the thread pool. According to the method and the device, a single-thread processing mode in the netty is changed into a multi-thread processing mode by polling the netty thread pool at the server side, so that the message processing speed is increased.
本发明提供了一种基于netty框架的多线程消息处理方法,涉及计算机信息处理技术领域,包括创建事件循环组构建线程池,创建udp启动类,并绑定自定义处理类,关联指定端口进行监听,在自定义处理类中实现对事件循环组的循环算法,通过轮询线程池的方式执行消息解析。本发明通过在服务端通过轮询netty线程池的方式,将netty内部的单线程处理方式变为多线程,提高了消息处理的速度。 |
---|