Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add anticipatedConcurrentIncoming[Bi/Uni]directionalStreams attributes & constructor arg #574

Merged
merged 15 commits into from
Feb 27, 2024
63 changes: 63 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,9 @@ interface WebTransport {
readonly attribute Promise<undefined> ready;
readonly attribute WebTransportReliabilityMode reliability;
readonly attribute WebTransportCongestionControl congestionControl;
[EnforceRange] attribute unsigned short? anticipatedConcurrentIncomingUnidirectionalStreams;
[EnforceRange] attribute unsigned short? anticipatedConcurrentIncomingBidirectionalStreams;

readonly attribute Promise<WebTransportCloseInfo> closed;
readonly attribute Promise<undefined> draining;
undefined close(optional WebTransportCloseInfo closeInfo = {});
Expand Down Expand Up @@ -688,6 +691,16 @@ A {{WebTransport}} object has the following internal slots.
throughput or low latency was requested by the application and satisfied
by the user agent, or `"default"`.
</tr>
<tr>
<td><dfn>`[[AnticipatedConcurrentIncomingUnidirectionalStreams]]`</dsfn>
<td class="non-normative">The number of concurrently open
[=incoming unidirectional=] streams the application anticipates the server creating, or null.
</tr>
<tr>
<td><dfn>`[[AnticipatedConcurrentIncomingBidirectionalStreams]]`</dfn>
<td class="non-normative">The number of concurrently open
[=bidirectional=] streams the application anticipates the server creating, or null.
</tr>
<tr>
<td><dfn>`[[Closed]]`</dfn>
<td class="non-normative">A promise fulfilled when the associated {{WebTransport}} object is
Expand Down Expand Up @@ -734,6 +747,10 @@ agent MUST run the following steps:
congestion control algorithms that optimize for |congestionControl|, as allowed by
[[!RFC9002]] [Section 7](https://www.rfc-editor.org/rfc/rfc9002#section-7),
then set |congestionControl| to `"default"`.
1. Let |anticipatedConcurrentIncomingUnidirectionalStreams| be {{WebTransport/constructor(url, options)/options}}'s
{{WebTransportOptions/anticipatedConcurrentIncomingUnidirectionalStreams}}.
1. Let |anticipatedConcurrentIncomingBidirectionalStreams| be {{WebTransport/constructor(url, options)/options}}'s
{{WebTransportOptions/anticipatedConcurrentIncomingBidirectionalStreams}}.
1. Let |incomingDatagrams| be a [=new=] {{ReadableStream}}.
1. Let |outgoingDatagrams| be a [=new=] {{WritableStream}}.
1. Let |datagrams| be the result of [=WebTransportDatagramDuplexStream/creating=] a
Expand All @@ -756,6 +773,10 @@ agent MUST run the following steps:
:: "pending"
: {{[[CongestionControl]]}}
:: |congestionControl|
: {{[[AnticipatedConcurrentIncomingUnidirectionalStreams]]}}
:: |anticipatedConcurrentIncomingUnidirectionalStreams|
: {{[[AnticipatedConcurrentIncomingBidirectionalStreams]]}}
:: |anticipatedConcurrentIncomingBidirectionalStreams|
: {{[[Closed]]}}
:: a new promise
: {{[[Draining]]}}
Expand Down Expand Up @@ -954,6 +975,30 @@ these steps.
:: Returns true if the user agent supports [=WebTransport sessions=] over exclusively reliable
[=connections=], otherwise false.

: <dfn for="WebTransport" attribute>anticipatedConcurrentIncomingUnidirectionalStreams</dfn>
:: Optionally lets an application specify the number of concurrently open
[=incoming unidirectional=] streams it anticipates the server creating.
If not null, the user agent SHOULD attempt to reduce future round-trips by taking
{{[[AnticipatedConcurrentIncomingUnidirectionalStreams]]}} into consideration in its
negotiations with the server.

The getter steps are to return [=this=]'s {{[[AnticipatedConcurrentIncomingUnidirectionalStreams]]}}.

The setter steps, given |value|, are to set [=this=]'s
{{[[AnticipatedConcurrentIncomingUnidirectionalStreams]]}} to |value|.

: <dfn for="WebTransport" attribute>anticipatedConcurrentIncomingBidirectionalStreams</dfn>
:: Optionally lets an application specify the number of concurrently open
[=bidirectional=] streams it anticipates the server creating.
If not null, the user agent SHOULD attempt to reduce future round-trips by taking
{{[[AnticipatedConcurrentIncomingBidirectionalStreams]]}} into consideration in its
negotiations with the server.

The getter steps are to return [=this=]'s {{[[AnticipatedConcurrentIncomingBidirectionalStreams]]}}.

The setter steps, given |value|, are to set [=this=]'s
{{[[AnticipatedConcurrentIncomingBidirectionalStreams]]}} to |value|.

jan-ivar marked this conversation as resolved.
Show resolved Hide resolved
## Methods ## {#webtransport-methods}

<div algorithm>
Expand Down Expand Up @@ -1222,6 +1267,8 @@ dictionary WebTransportOptions {
boolean requireUnreliable = false;
sequence&lt;WebTransportHash&gt; serverCertificateHashes;
WebTransportCongestionControl congestionControl = "default";
[EnforceRange] unsigned short? anticipatedConcurrentIncomingUnidirectionalStreams = null;
[EnforceRange] unsigned short? anticipatedConcurrentIncomingBidirectionalStreams = null;
};

enum WebTransportCongestionControl {
Expand Down Expand Up @@ -1267,6 +1314,22 @@ that determine how the [=WebTransport session=] is established and used.
</p>
</div>

: <dfn for="WebTransportOptions" dict-member>anticipatedConcurrentIncomingUnidirectionalStreams</dfn>
:: Optionally lets an application specify the number of concurrently open
[=incoming unidirectional=] streams it anticipates the server creating.
If not null, the user agent SHOULD attempt to reduce round-trips by taking
{{[[AnticipatedConcurrentIncomingUnidirectionalStreams]]}} into consideration in its
negotiations with the server.
[[!QUIC]][Section 19.11](https://www.rfc-editor.org/rfc/rfc9000#section-19.11)
jan-ivar marked this conversation as resolved.
Show resolved Hide resolved

: <dfn for="WebTransportOptions" dict-member>anticipatedConcurrentIncomingBidirectionalStreams</dfn>
:: Optionally lets an application specify the number of concurrently open
[=bidirectional=] streams it anticipates a server creating.
If not null, the user agent SHOULD attempt to reduce round-trips by taking
{{[[AnticipatedConcurrentIncomingBidirectionalStreams]]}} into consideration in its
negotiations with the server.
[[!QUIC]][Section 19.11](https://www.rfc-editor.org/rfc/rfc9000#section-19.11)
jan-ivar marked this conversation as resolved.
Show resolved Hide resolved

<div algorithm>
To <dfn>compute a certificate hash</dfn>, given a |certificate|, perform the following steps:
1. Let |cert| be |certificate|, represented as a DER encoding of
Expand Down
Loading