Skip to content

Commit ccaddea

Browse files
Close WebSocket and WebTransport connections when offline
1 parent 3bb4b06 commit ccaddea

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

index.bs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,13 @@ spec: RFC9110; urlPrefix: https://httpwg.org/specs/rfc9110.html
328328
spec: STREAMS; urlPrefix: https://streams.spec.whatwg.org/
329329
type: dfn
330330
text: ReadableStream; url: #readablestream
331+
spec: WebSockets; urlPrefix: https://websockets.spec.whatwg.org/
332+
type: dfn
333+
text: WebSocket; url: #websocket
334+
text: Make disappear; url: #make-disappear
335+
spec: WebTransport; urlPrefix: https://w3c.github.io/webtransport/
336+
type: dfn
337+
text: Cleanup WebTransport; url: #webtransport-cleanup
331338
</pre>
332339

333340
<style>
@@ -6214,6 +6221,34 @@ context.
62146221
</dd>
62156222
</dl>
62166223

6224+
<div algorithm>
6225+
6226+
To <dfn>apply network conditions</dfn>:
6227+
6228+
1. For each [=WebSocket=] object |webSocket|:
6229+
6230+
1. Let |realm| be |webSocket|'s [=relevant Realm=].
6231+
6232+
1. Let |environment settings| be the [=environment settings object=] whose
6233+
[=realm execution context=]'s Realm component is |realm|.
6234+
6235+
1. If the result of [=WebDriver BiDi network is offline=] with |environment settings| is true:
6236+
6237+
1. [=Make disappear=] |webSocket|.
6238+
6239+
1. For each [=WebTransport=] object |webTransport|:
6240+
6241+
1. Let |realm| be |webSocket|'s [=relevant Realm=].
6242+
6243+
1. Let |environment settings| be the [=environment settings object=] whose
6244+
[=realm execution context=]'s Realm component is |realm|.
6245+
6246+
1. If the result of [=WebDriver BiDi network is offline=] with |environment settings| is true:
6247+
6248+
1. [=Cleanup WebTransport=] |webTransport|.
6249+
6250+
</div>
6251+
62176252
<div algorithm="remote end steps for emulation.setNetworkConditions">
62186253

62196254
The [=remote end steps=] with |command parameters| and |session| are:
@@ -6259,6 +6294,8 @@ The [=remote end steps=] with |command parameters| and |session| are:
62596294
[=emulated network conditions/default network conditions=][|user context|] to
62606295
|emulated network conditions|.
62616296

6297+
1. [=Apply network conditions=].
6298+
62626299
1. Return [=success=] with data null.
62636300

62646301
</div>

0 commit comments

Comments
 (0)