最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。
WebSocket is a protocol that HTML5 began to provide for full-duplex communication over a single TCP connection.
WebSocket makes it easier to exchange data between the client and the server, allowing the server to actively push data to the client. In WebSocket API, only one handshake is needed between the browser and the server, and a persistent connection can be directly created between the browser and the server for two-way data transmission.
In WebSocket API, the browser and the server only need to shake hands, and then a fast channel is formed between the browser and the server. Data can be transmitted directly between the two.
Now, in order to implement the push technology, many websites use Ajax polling. Polling is a browser in which the browser issues a HTTP request to the server at a specific time interval (such as every 1 second), and then the server returns the latest data to the client. This traditional mode brings obvious disadvantages, that is, browsers need to constantly send requests to the server, but HTTP requests may contain long headers, in which the really effective data may be only a small part, which will obviously waste a lot of bandwidth and other resources.
The WebSocket protocol defined by HTML5 can better save server resources and bandwidth, and can communicate in more real time.

The browser sends a request to the server to establish a WebSocket connection through JavaScript. After the connection is established, the client and the server can exchange data directly through the TCP connection.
When you get the Web Socket connection, you can use the send() method to send data to the server, and through the onmessage event to receive the data returned by the server.
The following API is used to create the WebSocket object.
var Socket = new WebSocket(url, [protocol] ); The first parameter in the above code The following is Attribute Description Socket.readyState The read-only attribute readyState represents the connection status and can have the following values: 0-indicates that the connection has not been established. 1-indicates that the connection is established and can communicate. 2-indicates that the connection is being closed. 3-indicates that the connection is closed or cannot be opened. Socket.bufferedAmount The read-only attribute bufferedAmount has been placed in a queue by send () waiting for transmission, but the number of bytes of UTF-8 text that have not been issued. The following are events related to the WebSocket object. Suppose we created the Socket object using the above code: Event Event handler Description Open Socket.onopen Triggered when a connection is established Message Socket.onmessage Triggered when the client receives server data Error Socket.onerror Triggered when a communication error occurs Close Socket.onclose Triggered when the connection is closed The following is Method Description Socket.send () Send data using a connection Socket.close () Close the connection WebSocket protocol is essentially a TCP-based protocol. In order to establish a WebSocket connection, the client browser first initiates a HTTP request to the server, which, unlike the usual HTTP request, contains some additional header information, in which the additional header information “Upgrade: WebSocket” indicates that this is a HTTP request to apply for protocol upgrade. The server parses the additional header information and then generates the reply information and returns it to the client. The WebSocket connection between the client side and the server side is established, and both parties can freely transmit information through this connection channel, and the connection will persist until the client or server side actively closes the connection. At present, most browsers support Before performing the above procedure, we need to create a service that supports WebSocket. From pywebsocket download mod_pywebsocket Python environment support is required extract the downloaded file. Enter the pywebsocket directory. Execute command: url that specifies the URL of the connection The second parameter protocol is optional and an acceptable subprotocol is specified. 11.57.1. WebSocket attribute ¶
WebSocket Properties of the object. Suppose we used the above code to create the Socket Object: 11.57.2. WebSocket event ¶
11.57.3. WebSocket method ¶
WebSocket gets or sets the related methods. Suppose we used the above code to create the Socket object: 11.57.4. WebSocket instance ¶
11.57.5. HTML and JavaScript of the client ¶
WebSocket() interface, you can try examples in the following browsers: Chrome, Mozilla, Opera and Safari. runoob_websocket.html file content
11.57.6. Install pywebsocket ¶
mod_pywebsocket or use the git command to download:git clone https://github.com/googlearchive/pywebsocket
$ python setup.py build $ sudo python setup.py install