HTML and CSS Reference
In-Depth Information
Figure 4-11. Conversation between web clients
Pings and Pongs
Depending on your server configuration, this application might automatically disconnect
after a period of time. The disconnection is probably because the server sent a ping and
the client didn't promptly respond with a pong. Pings and pongs are used in XMPP for the
same purpose they are used in WebSocket: to keep connections alive and to check the
health of a connection. Pings and pongs use iq stanzas. In XMPP, “iq” stands for info/
query and is a way of performing request/response queries on top of the asynchronous
connection. A ping looks like Listing 4-15.
Listing 4-15. XMPP Server ping
<iq type="get" id="86-14" from="localhost"
to="websocketuser@localhost/cc9fd219" >
<ping xmlns="urn:xmpp:ping"/>
The server will expect a response in the form of an iq result with the matching ID
(see Listing 4-16).
Search WWH ::

Custom Search