System and method for counting number of online client sides based on TCP/IP communication protocol
A technology of IP communication and statistical methods, applied in the field of network communication, can solve the problems of inaccurate number of online clients, users cannot continue to communicate with the server, etc., to enhance stability, reliability and accuracy, and enhance statistical accuracy. Effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0097] Example 1 - A new client initiates a TCP connection request
[0098] 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:
[0099] S11: The epoll_wait function finds that the event to be processed is exactly equal to the listening socket descriptor socket_fd;
[0100] S12: Call the accept function according to socket_fd to return a new socket socket descriptor, denoted as fd;
[0101] S13: Add the monitored fd to the epoll handle through the epoll_ctl function.
[0102] 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
[0103] Example 2 - The event that the client that has established the connection disconnects the TCP connection
[0104] see Figure 5 , a flow chart of the steps of the event that the client that has established the connection disconnects the TCP connection provided by the application, including the following steps:
[0105] Step S21: The epoll_wait function finds that the triggering event to be processed is a socket descriptor, denoted as fd;
[0106] Step S22: calling the read function according to fd;
[0107] Step S23: judge whether the return value of the read function is equal to 0, if so, go to the next step; if not, go to other transaction processing;
[0108] Step S24: Find the location of the node according to the fd of the client that initiated the disconnection request, and delete the node from the dynamic linked list.
[0109] It can be understood that if the client that has already established a connection disconnects the TCP connection, then the return value...
Embodiment 3
[0111] Example 3 - The client that has established a TCP connection has an event of online command transmission
[0112] see Figure 8 , the processing flow chart of the event that the client that has established a TCP connection has an online command transmission provided by this application, including the following steps:
[0113] Step S31: The epoll_wait function finds that the triggering event to be processed is a socket descriptor, denoted as fd;
[0114] Step S32: calling the read function according to fd;
[0115] Step S33: judging whether the read return value is greater than 0, if so, go to the next step; if not, go to other processing;
[0116] Step S34: Determine whether the data packet is HEL; xxxxxxxxxxx; @ format, wherein HEL is the abbreviation of hello, xxxxxxxxxxxx is the ID of the client, separated by a semicolon ";", and ends with @ at the end, if so, proceed to the following One step; if not, proceed to other transactions;
[0117] Step S35: Extract the...
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