Skip to content

Commit

Permalink
Merge pull request #574 from jan-ivar/maxstreams
Browse files Browse the repository at this point in the history
Add anticipatedConcurrentIncoming[Bi/Uni]directionalStreams attributes & constructor arg
  • Loading branch information
jan-ivar authored Feb 27, 2024
2 parents 09dc62d + 701e688 commit 8db4c49
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,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 @@ -690,6 +693,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 @@ -736,6 +749,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 @@ -758,6 +775,10 @@ agent MUST run the following steps:
:: "pending"
: {{[[CongestionControl]]}}
:: |congestionControl|
: {{[[AnticipatedConcurrentIncomingUnidirectionalStreams]]}}
:: |anticipatedConcurrentIncomingUnidirectionalStreams|
: {{[[AnticipatedConcurrentIncomingBidirectionalStreams]]}}
:: |anticipatedConcurrentIncomingBidirectionalStreams|
: {{[[Closed]]}}
:: a new promise
: {{[[Draining]]}}
Expand Down Expand Up @@ -956,6 +977,34 @@ 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|.

Note: Setting {{WebTransport/anticipatedConcurrentIncomingUnidirectionalStreams}} or
{{WebTransport/anticipatedConcurrentIncomingBidirectionalStreams}} does not guarantee
the application will receive the number of streams it anticipates.

## Methods ## {#webtransport-methods}

<div algorithm>
Expand Down Expand Up @@ -1243,6 +1292,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 @@ -1288,6 +1339,20 @@ 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.

: <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.

<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

0 comments on commit 8db4c49

Please sign in to comment.