Method, system and device for communication by virtue of socket connection
A socket and direct technology, applied in the field of communication, can solve problems such as unsupported terminals and reduced terminal security, and achieve the effect of eliminating potential safety hazards
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0038] Such as figure 2 As shown, it is a method for communicating through a Socket connection in Embodiment 1 of the present application, and the method includes the following steps:
[0039] Step 101: The browser detects its own status, and determines whether it is a master browser or a slave browser. If it is the master browser, then execute step 102; otherwise, execute step 106.
[0040] When the terminal starts the browser for the first time (that is, when the browser starts, there are no other running browsers), the browser connects through HTTP, downloads the Javascript script from the server, and calls the WebSQL API in HTML5 through the Javascript script to create a database. If the established database is a statically established database, the database is activated through the Javascript; if the established database is a dynamically established database, the Javascript is used to request resource allocation for the database to establish the database.
[0041] When...
Embodiment 2
[0087] Embodiment 2 of the present application illustrates the solution of Embodiment 1 through a specific example.
[0088] Assuming that the number of master browsers in the second embodiment of the present application is 1, regardless of the master and slave browsers, the messages to be sent and the messages returned by the server are all stored in the database.
[0089] The scheme of embodiment two comprises the following steps:
[0090] The first step: start the browser 1, and the browser 1 downloads the page and the Javascript script from the server through the HTTP connection.
[0091] Step 2: The browser 1 determines that there is no other activated browser currently, and calls the WebSQL API in the HTML5 specification through a Javascript script to establish a database in the terminal.
[0092] Step 3: Browser 1 determines itself as the main browser, and registers in the registry in the database.
[0093] Described registration form is as shown in table 1, and each ...
Embodiment 3
[0122] Embodiment 3 of the present application provides a system for communicating through a Socket connection, such as image 3 As shown, the system includes a server 11, a browser 12 running in a terminal, and a database 13 embedded in the browser, wherein: the browser 12 is used to detect itself as a master browser or a slave browser, if the master Browser, then set up the Socket connection between server 11, and when there is a message to be sent written by each browser running in the terminal that has started in the database 13, the message to be sent is connected by Socket Send to server 11, and write the message that server 11 returns into described database 13; If when from browser, write in database 13 with the message to be sent to server 11 by oneself, and read the server stored in database 13 The message returned by 11; the server 11 is used to establish a Socket connection with the browser 12, and receive the message sent by the browser 12 through the Socket conne...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 