Network communication system and method based on TCP/IP communication protocol
A technology of network communication and IP communication, which is applied in the field of network communication system based on TCP/IP communication protocol, can solve the problems of large memory overhead, system error, difficult to meet massive user connections and concurrent communication, etc., and achieve the improvement of hardware resources Effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0092] Example 1 - A new client initiates a TCP connection request
[0093] see Figure 4 , a flow chart of steps for the event processing of a new client initiating a TCP connection request provided by this application, including the following steps:
[0094] S11: The epoll_wait function finds that the event to be processed is exactly equal to the listening socket descriptor socket_fd;
[0095] S12: Call the accept function according to socket_fd to return a new socket socket descriptor, denoted as fd;
[0096] S13: Add the monitored fd to the epoll handle through the epoll_ctl function.
[0097] It can be understood that the occurrence of this client event does not immediately complete the online work of the client (requires the online command below), but only requires the client to initiate a TCP connection request before obtaining the fd assigned to it by the server, because the client who has already established a connection The terminal must pass fd to transmit data w...
Embodiment 2
[0098] Example 2 - The client that has established a connection initiates an online command
[0099] see Figure 5 , which is a flow chart of the server processing when the connection has been established and the client sends an online command to the server provided by this application, including the following steps:
[0100] S21: The epoll_wait function finds that the triggering event to be processed is a socket descriptor, denoted as fd;
[0101]S22: calling the read function according to fd;
[0102] S23: judge whether the read return value is greater than 0, if so, go to the next step; if not, go to exception handling;
[0103] S24: Determine whether the data packet is in the format of HEL;xxxxxxxxxxx;@, wherein, HEL is the abbreviation of hello, xxxxxxxxxxxx is the ID of the client, separated by a semicolon ";", and ends with @, if so, go to the next step ; If not, process other data packets or commands according to the protocol;
[0104] S25: Extract the xxxxxxxxxxxx...
Embodiment 3
[0108] Embodiment 3 - protocol for communication between clients
[0109] see Figure 8 , which is a flow chart of server processing when online clients communicate with each other provided by this application, including the following steps:
[0110] S31: The epoll_wait function finds that the triggering event to be processed is a socket descriptor, denoted as fd;
[0111] S32: call the read function according to fd;
[0112] S33: judge whether the read return value is greater than 0, if so, go to the next step; if not, go to other processing;
[0113] S34: Determine whether the data packet is DATA; ID_send; ID_rec; content; @ format, wherein ID_send represents the ID number of the sender, which is recorded as the ID of client I, and ID_rec represents the ID number of the receiver, which is recorded as the client ID of II, if yes, proceed to the next step; if not, process other data packets or commands according to the protocol;
[0114] S35: extract ID_send, ID_rec, conte...
PUM
Abstract
Description
Claims
Application Information
- 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