WebSocket (Socket function)

From m204wiki
Revision as of 15:01, 13 August 2019 by Tom (talk | contribs) (→‎Usage notes)
Jump to navigation Jump to search

Convert Web thread to WebSocket thread (Socket class)

[Introduced in Model 204 7.8 βeta]


This page is under construction.

Syntax

%socket = [%(Socket):]WebSocket

Syntax terms

%outSocketSocket object
[%(Socket):] The optional class name in parentheses denotes a virtual constructor. See "Usage notes", below, for more information about invoking a virtual constructor.

Usage notes

This function will upgrade a Janus Web thread to use the WebSocket protocol for simple two-way data transfer between the http client and the server.

The Janus Web request must contain the required http headers to allow the upgrade to occur.

This function must be called from a Janus Web Server SOUL program. The Janus Web port must be enabled for Web Socket upgrades with the WEBSOCKET parameter. The WEBSOCKET option can be specified on either the port definition or the JANUS WEB rule for the URL.

Any other usage will result in request cancellation.

Examples

See also