Using WebSocket in point-to-point communication

Assume that the client need not send message to multiple clients. That is, the bi-directional communication is only between one client and server.

So unlike in the broadcast model, you do not need a channel for communication and therefore need not define it in the Application.cfc.

Do the following to set up a point-to-point communication:

  1. Create the WebSocket object using the cfwebsocket tag.

    For details, see Creating WebSocket object using cfwebsocket.

  2. To send a message to the server, use the JavaScript method Invoke.

  3. To send additional messages, use the function WSSendMessage.