Communication method and device, electronic device and computer readable storage medium

A communication method and computer program technology, applied in the field of communication, can solve problems such as client system memory leaks, and achieve the effects of avoiding memory leaks, avoiding reduction, and avoiding occupation

Active Publication Date: 2020-09-01
TENCENT MUSIC ENTERTAINMENT TECH SHENZHEN CO LTD
View PDF9 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

When the client communicates with the server using a UDP socket (socket) connection, if the client does not process the return packet from the server, but the server keeps sending packets to the client, the client system will appear "memory leakage"

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
  • Communication method and device, electronic device and computer readable storage medium
  • Communication method and device, electronic device and computer readable storage medium
  • Communication method and device, electronic device and computer readable storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0036] The applicant of the present application has found through research that, by default, the communication mode of the socket is full-duplex, that is, for the creator of the socket, both data packets can be sent and data packets can be received. The TCP type socket provides the shutdown() API (full name in Chinese: application programming interface, full name in English: Application Programming Interface) that can set the socket to half-duplex, that is, for the creator of the socket, only data packets can be sent or Only packets can be received. But for UDP sockets, the kernel does not provide a similar API. For a UDP socket in full-duplex state, if the initiator of the communication does not pay attention to the reply packet from the peer end, the user mode process will not read the reply packet in the socket receiving buffer, which will cause a memory leak on the local end.

[0037] Therefore, in this application, a new protocol type is added for communication between d...

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 discloses a communication method and device and system, an electronic device and a computer readable storage medium. The method comprises the steps of determining address information ofa second device and a protocol type of communication between a first device and the second device; creating a target connection based on the address information and the protocol type, and recording connection information of the target connection into a connection pool corresponding to the protocol type; wherein the connection information comprises address information and a file descriptor of the target connection; if the protocol type is the UDP type of the write-only mode, sending a first data packet to the second device through the target connection; when a second data packet from second device is received through the target connection, performing packet loss processing on the second data packet; wherein the first data packet and the second data packet are both UDP type data packets. Therefore, according to the communication method provided by the invention, the memory leakage when the UDP type connection communication is used is avoided, the memory occupation is obviously reduced, and the device performance is improved.

Description

technical field [0001] The present application relates to the technical field of communication, and more specifically, to a communication method, device, electronic device, and computer-readable storage medium. Background technique [0002] In related technologies, the connection pool component generally includes two types of protocol connection pools, namely TCP (full name in Chinese: Transmission Control Protocol, full name in English: Transmission Control Protocol) type connection pool and UDP (full name in Chinese: User Datagram Protocol, English full name: User Datagram Protocol) type of connection pool. When the client communicates with the server using a UDP socket (socket) connection, if the client does not process the return packet from the server, but the server keeps sending packets to the client, the client system will appear "memory leakage". [0003] Therefore, how to avoid memory leaks when using the UDP type connection communication is a technical problem t...

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/06
CPCH04L69/03H04L69/164H04L69/162H04L69/18
Inventor 余昌叶
Owner TENCENT MUSIC ENTERTAINMENT TECH SHENZHEN 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