Method for maintaining long connection by sending heartbeat packet
A heartbeat packet, long connection technology, applied in the field of communication, can solve the problems of performance waste and short heartbeat packet interval (less than 2 minutes, etc., to reduce the processing time of heartbeat packets and improve performance.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment Construction
[0048] Such as figure 2 As shown, the keepAlive option of the TCP protocol proposed by the present invention is a function of the TCP protocol itself and belongs to the transport layer. When the server receives the keepAlive detection packet sent by the client, it can reply to the client at the transport layer, and will not go to the upper layer Submit, so the efficiency is much higher.
[0049] A method for sending heartbeat packets to maintain a long connection in the present invention comprises the following steps:
[0050] Step 1: Turn on the keepAlive switch and set the keepAlive parameters, including:
[0051] client:
[0052] Step A1: Establish a TCP Socket client;
[0053] Step A2: Turn on the SO_KEEPALIVE option;
[0054] Step A3: Set TCP_KEEPIDLE as the heartbeat packet interval period;
[0055] Step A4: Set TCP_KEEPINTVL to 5 seconds;
[0056] Step A5: Set TCP_KEEPCNT to 2 times;
[0057] Step A6: Start blocking read and write;
[0058] Server:
[0059] St...
PUM
![No PUM](https://static-eureka.patsnap.com/ssr/23.2.0/_nuxt/noPUMSmall.5c5f49c7.png)
Abstract
Description
Claims
Application Information
![application no application](https://static-eureka.patsnap.com/ssr/23.2.0/_nuxt/application.06fe782c.png)
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com