OpenSource For You

Client-side API

-

The WebSocket object attribute websocketo­bjext.readystate shows the different stages of connection establishm­ent; the possible values and meanings are: 1) The connection is not yet establishe­d; 2) The connection is establishe­d and communicat­ion is possible; 3) The connection is at the stage of closing the handshake; and 4) The connection is closed. The websocketo­bject.bufferedam­ount attribute shows the number of bytes queued to send.

WebSocket events include onopen(), triggered when a connection is opened; onclose(), when it is closed; onerror(), when any error occurs; and onmessage(), when a new message is received from the server.

WebSocket methods include send() to send a message to

Newspapers in English

Newspapers from India