Synchronous and asynchronous communication control method, system and device

An asynchronous communication and control method technology, applied in the communication field, can solve the problems of high-level control ability of developers, complex implementation of asynchronous transmission, poor error rate and stability, etc., to achieve stable and reliable programs, low code coupling, and development efficiency high effect

Inactive Publication Date: 2019-03-08
DIRUI MEDICAL TECH CO LTD
View PDF4 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0009] In view of the deficiencies in the above-mentioned prior art, the purpose of the present invention is to provide a synchronous and asynchronous communication control method, system and device based on Linux C, to overcome th

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
  • Synchronous and asynchronous communication control method, system and device
  • Synchronous and asynchronous communication control method, system and device
  • Synchronous and asynchronous communication control method, system and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0042] In order to make the object, technical solution and advantages of the present invention more clear and definite, the present invention will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

[0043] The first embodiment that the present invention provides is a kind of synchronous and asynchronous communication control method based on Linux C, such as figure 1 shown, including:

[0044] Step S1, start the multi-thread communication data transmission, set the result value of the data transmission as the initial value, and start the timer synchronously.

[0045] The terminal first starts this multi-thread communication data transmission, first sets the result value of the data transmission as an initial value, and starts a timer to time the time of each started thread communica...

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 provides a synchronous and asynchronous communication control method, system and device. The asynchronous communication is controlled by adding a data transmission communication handle generated by each thread to a chain list. When the reply message is received before the timer expires, the result value is set to success or failure according to the reply message and the communicationhandle is deleted from the linked list. When the timer expires and no reply message is received, the result value is set as timeout according to the reply message, also supports the cancel operationsto terminate the thread and end this asynchronous communication. Compared with the common polling or callback mode, the invention has the advantages of simpler code, clearer logic and more convenientuse, and is suitable for application in large-scale projects. In addition, encapsulating the communication handle according to the object-oriented idea conforms to the concept of object-oriented andcomponent development, separates the business and complex underlying technology effectively, and has high development efficiency, low code coupling, stable and reliable program.

Description

technical field [0001] The present invention relates to the technical field of communication, in particular to a Linux C-based synchronous and asynchronous communication control method, system and device. Background technique [0002] Technology With the popularity of the Linux operating system, from desktops to embedded and mobile devices, the Linux operating system is involved everywhere. Especially in the field of embedded automatic control, the application of Linux system is extremely extensive. Information communication methods are divided into synchronous and asynchronous methods. The synchronous method is to wait for the result after sending, and cannot do other work before the result is received; the asynchronous method can do multiple tasks at the same time, and can wait for all or partial results. Obviously, asynchronous communication is more efficient, but the complexity will also increase exponentially. The asynchronous communication of the Linux system needs ...

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
IPC IPC(8): G06F9/54H04L12/40
CPCG06F9/546G06F2209/547H04L12/40006H04L2012/40215
Inventor 张洪伟
Owner DIRUI MEDICAL TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products