Unlock instant, AI-driven research and patent intelligence for your innovation.

A method of linking barrage and mobile terminal

A barrage, socket technology, applied in image communication, selective content distribution, electrical components, etc., can solve the problems of easy interruption of connection, unstable network, and slow recovery process.

Active Publication Date: 2022-02-08
WUHAN DOUYU NETWORK TECH CO LTD
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In the traditional solution, for the barrage connection between the client of the mobile terminal and the server, only the availability of the function is considered, and the characteristics of the mobile terminal are not considered, for example, the network is unstable, the power consumption of the mobile terminal, heating and other characteristics
Therefore, the connection between the mobile terminal and the barrage server is easily interrupted, and the process of restoring the connection is slow

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
  • A method of linking barrage and mobile terminal
  • A method of linking barrage and mobile terminal
  • A method of linking barrage and mobile terminal

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0025] See figure 1 The flow diagram of a method of linking the bracket provided by the embodiment of the present invention, specifically includes:

[0026] 101. Create the related data of the socket Socket and link with the barrage server.

[0027] The mobile terminal creates the related data of the socket socket and links the barrage server. Where related data includes int SockFD = Socket (AF_INET, SOCK_STREAM, 0), address family servaddr.sin_family = IP, port number (servaddr.sin_port = htons (port)) and system function int nret = connect (Sockfd, (Struct SockAddr) *) & servaddr, sizeof (servaddr)).

[0028]102. Determine the network interrupt object SocketBreaker.

[0029] The mobile terminal determines the network interrupt object SocketBreaker, which is used to trigger the Socket interrupt current link. Specifically, the mobile terminal defines an object function socketbreaker PIPE, which is used to terminate the current link to the Socket chain contact.

[0030] 103. Creati...

specific Embodiment

[0059] Incidentally, in the above embodiment, the present invention can also be implemented in other ways, for example, the design of the upper socket queue-based message, and to process the data received socket data to be transmitted, the specific embodiment for example:

[0060] Step 1, to determine the C ++ classes to process encapsulated data network.

[0061] The function of this step is a step corresponding to the code in the upper layer, which will receive all event messages in the event. First, the present embodiment is designed a c ++ classes that encapsulate process all network data, and the data will occur, the reception data, and during the entire socket of of the socket errors isolated design, so that the logic clearer reception data event is only responsible for the data received, the data event occurs only responsible for sending data, socket socket error event is only responsible for error handling. class TcpClient {a message queue which is designed to store all th...

Embodiment 3

[0072] Incidentally, in the above embodiment, the present invention can also be implemented in other ways, e.g., based on the status code to design socket linking scheme, even if the re-design of specific embodiment are as follows:

[0073] Step 1, to generate a mapping table stored in the status code.

[0074] First, there are many state code, an error occurs when a socket, you need to get the current status code generated to query the need for reconnection. When it comes to the query you need to consider the performance of queries. To store status codes based on the standard template library STL container map container according to the present embodiment. When the query is searched based on map container can be fairly rapid, map mapStatus; present embodiment defines a map type object mapStatus. in. The first parameter is a key value map int a container for storing a status code socket, bool second parameter code for storing the current state of the need for reconnection. Next,...

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 method for linking bullet chatting and a mobile terminal, which are used for optimizing the process of linking bullet chatting and improving the efficiency of linking bullet chatting. The method of the present invention comprises: creating the related data of the socket socket, and linking with the barrage server; determining the network interruption object SocketBreaker, and the SocketBreaker is used to trigger the socket to interrupt the current link; creating a network selection object select, which is used to monitor the socket Status information; create an event object event, which is used to notify the status information of the socket; create the thread object Thread of the socket and execute the execution function void__RunThread() of the Thread; create a while loop in the execution function to monitor the state of the socket; read the received socket in the socket The data sent by the barrage server; send the data to be sent to the barrage server through the socket.

Description

Technical field [0001] The present invention relates to the field of terminal, and more particularly to a method of linking the barrage and a mobile terminal. Background technique [0002] With the rapid development of Internet technology, the function of mobile terminal is increasing, and the barrage function for improving the user experience also appears on the mobile terminal. [0003] In the conventional solution, it is usually transplanted to the mobile terminal. For mobile terminals, there is a characteristic, such as network instability, using mobile 4G network, and mobile terminal will move, for example, mobile terminals move to a network signal; or switch from 3G network to 4G network Alternatively, switch from 4G network to wireless fidelity, WiFi network; or switch from WiFi to 4G network, etc.. At the same time, the server will determine the client validity due to the various reasons for the barrage or due to the account, so that the error code is returned, so that th...

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 Patents(China)
IPC IPC(8): H04N21/254H04N21/488H04N21/858
CPCH04N21/254H04N21/4884H04N21/8586
Inventor 周志刚
Owner WUHAN DOUYU NETWORK TECH CO LTD