Skip to content

Commit 431fbad

Browse files
Close WebSocket and WebTransport connections when offline
1 parent c97c760 commit 431fbad

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>
@@ -6327,6 +6334,34 @@ context.
63276334
</dd>
63286335
</dl>
63296336

6337+
<div algorithm>
6338+
6339+
To <dfn>apply network conditions</dfn>:
6340+
6341+
1. For each [=WebSocket=] object |webSocket|:
6342+
6343+
1. Let |realm| be |webSocket|'s [=relevant Realm=].
6344+
6345+
1. Let |environment settings| be the [=environment settings object=] whose
6346+
[=realm execution context=]'s Realm component is |realm|.
6347+
6348+
1. If the result of [=WebDriver BiDi network is offline=] with |environment settings| is true:
6349+
6350+
1. [=Make disappear=] |webSocket|.
6351+
6352+
1. For each [=WebTransport=] object |webTransport|:
6353+
6354+
1. Let |realm| be |webSocket|'s [=relevant Realm=].
6355+
6356+
1. Let |environment settings| be the [=environment settings object=] whose
6357+
[=realm execution context=]'s Realm component is |realm|.
6358+
6359+
1. If the result of [=WebDriver BiDi network is offline=] with |environment settings| is true:
6360+
6361+
1. [=Cleanup WebTransport=] |webTransport|.
6362+
6363+
</div>
6364+
63306365
<div algorithm="remote end steps for emulation.setNetworkConditions">
63316366

63326367
The [=remote end steps=] with |command parameters| and |session| are:
@@ -6372,6 +6407,8 @@ The [=remote end steps=] with |command parameters| and |session| are:
63726407
[=emulated network conditions/default network conditions=][|user context|] to
63736408
|emulated network conditions|.
63746409

6410+
1. [=Apply network conditions=].
6411+
63756412
1. Return [=success=] with data null.
63766413

63776414
</div>

0 commit comments

Comments
 (0)