Skip to content

Commit 1f9a2d6

Browse files
committed
Revert "Remove mention of passing close code or reason to abort() or cancel()"
Put back mention of passing close code or reason to abort() or cancel(), in preparation for updating it to use WebSocketError.
1 parent 5cb355b commit 1f9a2d6

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

index.bs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,11 @@ initially unset.
876876
as ArrayBuffer objects.
877877

878878
The stream can be closed by calling {{ReadableStream/cancel()}} on
879-
{{WebSocketOpenInfo/readable}}.
879+
{{WebSocketOpenInfo/readable}}. If the argument passed to {{ReadableStream/cancel()}} is an
880+
object with a {{WebSocketCloseInfo/code}} property and an <span class=allow-2119>optional</span> {{WebSocketCloseInfo/reason}}
881+
property then {{WebSocketCloseInfo/code}} will be used as [=the WebSocket connection close
882+
code=] and {{WebSocketCloseInfo/reason}} or the empty string will be used as [=the WebSocket
883+
connection close reason=].
880884

881885
If no messages are read, or if messages are read slower than they are sent, then backpressure
882886
will be applied and eventually the server will stop sending new messages.
@@ -889,8 +893,13 @@ initially unset.
889893
{{WritableStreamDefaultWriter/ready|writer.ready}} promise will ensure that backpressure is
890894
obeyed.
891895

892-
The WebSocket can be closed by calling {{WritableStream/close()}} or {{WritableStream/abort()}}
893-
on {{WebSocketOpenInfo/writable}}.
896+
The WebSocket can be closed by calling {{WritableStream/close()}} on
897+
{{WebSocketOpenInfo/writable}}.
898+
899+
The stream can also be closed by calling {{WritableStream/abort()}}
900+
{{WebSocketOpenInfo/writable}}. If an argument is passed to {{WritableStream/abort()}} then it
901+
can be used to specify [=the WebSocket connection close code=] and [=the WebSocket connection
902+
close reason=] as with {{ReadableStream/cancel()}} above.
894903

895904
: {{WebSocketOpenInfo/extensions}}
896905
:: The [=extensions in use=] for the connection.

0 commit comments

Comments
 (0)