Ajax and Comet with IFrames are polling methods. That is, a polling system is used instead of a push method for receiving data. The server sends messages to the client, the client sends a response to the server. The Comet technique has generally been the best choice to stay connected to avoid repeated requests. It must be re-connected to close the connection after a certain time period. This technique is reflected in HTML5, and was a factor leading to the design of WebSockets. WebSocket is a protocol that provides a bidirectional connection between the web server and the client. Unlike existing sockets, WebSocket provides actual two-way connection [14]. It begins with a HTTP-based handshake, then the WebSocket protocol takes over to facilitate communication. Because of its more advanced design compared to existing methods such as Comet, WebSocket establishes two-way connection in
a different way; traffic is very light using WebSocket, and it demonstrates superior
performance [15]. Figure 4 displays a comparison of polling methods and the WebSocket
system.