SendWebSocket (Socket function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
Line 12: Line 12:
<td>string</td></tr>
<td>string</td></tr>
<tr><th>number</th>
<tr><th>number</th>
<td>number</td></tr>
<td>number is an op code indicating the type of web socket frame. Numbers 0-7 are non-control frames. Numbers 8-15 are control frames. Control frames are always sent immediately and cannot be fragmented. Specifying a reserved code will cause immediate request cancellation.
<table>
<tr><th>0</th>
<td>A continuation frame. A continuation frame is treated as text or binary based on the op code of the first frame.</td></tr>
<tr><th>1</th>
<td>A text frame. Text frames are are translated to ASCII with the translate table in effect for the port.</td></tr>
<tr><th>2</th>
<td>A binary frame. No translation is done for binary frames.</td></tr>
<tr><th>3-7</th>
<td>Reserved for future use.</td></tr>
<tr><th>8</th>
<td>Connection close frame.</td></tr>
<tr><th>9</th>
<td>Ping.</td></tr>
<tr><th>10</th>
<td>Pong.</td></tr>
<tr><th>11-15</th>
<td>Reserved for future use.</td></tr>
<tr><th>128</th>
<td>This value is added to the frame op code to indicate the final fragment of a non-control message. The first fragment may also be the final fragment.</td></tr>
</table></td></tr>
</td></tr>
<tr><th>boolean</th>
<tr><th>boolean</th>
<td><var>Boolean</var> value that indicates whether to mask the data with a masking key. The default is not to mask the data. Masking is done using an internally generated masking key.</td></tr>
<td><var>Boolean</var> value that indicates whether to mask the data with a masking key. The default is not to mask the data. Masking is done using an internally generated masking key.</td></tr>

Revision as of 16:28, 13 August 2019

Send Web Socket framed message (Socket class)

[Introduced in Model 204 7.8 βeta]


This page is under construction.

Syntax

[%number =] socket:SendWebSocket( string, number, boolean)

Syntax terms

%numbernumber
socket Socket object
string string
number number is an op code indicating the type of web socket frame. Numbers 0-7 are non-control frames. Numbers 8-15 are control frames. Control frames are always sent immediately and cannot be fragmented. Specifying a reserved code will cause immediate request cancellation.
0 A continuation frame. A continuation frame is treated as text or binary based on the op code of the first frame.
1 A text frame. Text frames are are translated to ASCII with the translate table in effect for the port.
2 A binary frame. No translation is done for binary frames.
3-7 Reserved for future use.
8 Connection close frame.
9 Ping.
10 Pong.
11-15 Reserved for future use.
128 This value is added to the frame op code to indicate the final fragment of a non-control message. The first fragment may also be the final fragment.
boolean Boolean value that indicates whether to mask the data with a masking key. The default is not to mask the data. Masking is done using an internally generated masking key.

Usage notes

Examples

See also