@@ -876,7 +876,11 @@ initially unset.
876
876
as ArrayBuffer objects.
877
877
878
878
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=] .
880
884
881
885
If no messages are read, or if messages are read slower than they are sent, then backpressure
882
886
will be applied and eventually the server will stop sending new messages.
@@ -889,8 +893,13 @@ initially unset.
889
893
{{WritableStreamDefaultWriter/ready|writer.ready}} promise will ensure that backpressure is
890
894
obeyed.
891
895
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.
894
903
895
904
: {{WebSocketOpenInfo/extensions}}
896
905
:: The [=extensions in use=] for the connection.
0 commit comments