HTML and CSS Reference
In-Depth Information
the client to the server. A WebSocket server can also act as a WebSocket client. However,
with WebSocket, web clients like browsers cannot accept connections that they did not
initiate. Figure 3-3 shows WebSocket clients connected to a server, where either the client
or the server can send data at any time.
Figure 3-3. WebSocket clients connected to a server
WebSocket bridges the world of the Web and the world of the Internet (or more
specifically, TCP/IP). Asynchronous protocols that were not previously easy to use with
web applications can now easily communicate using WebSocket. Table 3-1 compares the
main areas of TCP, HTTP, and WebSocket.
Table 3-1. Comparison of TCP, HTTP, and WebSocket
Feature
TCP
HTTP
WebSocket
Addressing
IP address and port
URL
URL
Simultaneous transmission
Full duplex
Half duplex
Full duplex
Content
Byte streams
MIME messages
Text and binary
messages
Message boundaries
No
Yes
Yes
Connection oriented
Yes
No
Yes
 
 
Search WWH ::




Custom Search