Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Transmission method for publish/subscribe system based on NIO and IO

A transmission method and publish-subscribe technology, applied in the field of data transmission, can solve problems such as inability to modify, and achieve the effects of improving performance, reducing the number of threads, and reducing resource consumption

Inactive Publication Date: 2010-02-17
ZHEJIANG UNIV
View PDF0 Cites 32 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, since the poll polling operation is an uninterrupted process, it is the underlying API provided by Sun, which cannot be modified

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Transmission method for publish/subscribe system based on NIO and IO
  • Transmission method for publish/subscribe system based on NIO and IO

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0026] The present invention will be further described below in conjunction with accompanying drawing and embodiment:

[0027] figure 1 Among them, Client2 and Client3 are message subscribers, the two clients subscribe to the event notification service, and Client1 is the message publisher, responsible for sending messages to the event notification service, when the event notification service receives the message, it will subscribe to the message to send their subscribed messages. At this time, the message subscribers and message publishers are collectively referred to as the client, and the event notification service is the server.

[0028] like figure 2 As shown, the entire system is composed of a client and a server, and the respective operations of the client and the server are started to complete the entire transmission process of the message. The specific functions of the above parts are as follows:

[0029] Receive thread: The server monitors the thread, receives t...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to a transmission method for a publish / subscribe system based on NIO and IO, comprising the following steps: a thread that uniquely receives socket connection is started to use by using NIO at a server terminal, wherein the receiving thread comprises Selector objects, thread reading groups and thread writing groups; the Selector objects capture various events from a client, and the thread reading groups and thread writing groups are used for receiving socket connection from the client and writing data to the client; each thread reading or writing thread corresponds to a socket connection respectively and packages the received socket every time to form an object to read and write data and then registers the object to the unique Selector object. When the client is shutdown, the connection is logged out from the reading and writing threads, and after logout, the reading and writing threads can bind novel connections. The invention has the advantages that thread number is reduced by using NIO at the server terminal based on the mixed use of IO and NIO of java, thereby reducing the resource consumption; and the server terminal is connected at the client by using IO so that the speed for sending send messages can be improved greatly.

Description

technical field [0001] The invention relates to the field of data transmission, and mainly relates to a transmission method for a publish-subscribe system based on NIO and IO. Background technique [0002] Publish / subscribe (publish / subscribe, referred to as pub / sub) system is a distributed middleware system, which is a technology that emerges with complex and large-scale network computing. Provide a loosely coupled communication method. In a large-scale, highly dynamic distributed system, participants usually change dynamically in time and space. Participate in message interaction and collaborative work in a coupled way. The loosely coupled nature of the publish / subscribe system can just solve this problem. [0003] like figure 1 As shown, a publish / subscribe system generally consists of a message producer (publisher), a message consumer (subscriber) and an event notification service. In a publish / subscribe system, messages are usually called "events". Message producer...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): H04L29/08G06F9/46
Inventor 李莹王桢吴健邓水光施东材尹建伟吴朝晖
Owner ZHEJIANG UNIV
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products