Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The WebSocketStream Interface#48

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ricea wants to merge33 commits intomain
base:main
Choose a base branch
Loading
fromadd-websocketstream
Open
Changes from1 commit
Commits
Show all changes
33 commits
Select commitHold shift + click to select a range
579e413
[WIP] The WebSocketStream Interface
riceaNov 11, 2021
3c4803b
Fix grammatical errors
riceaJan 23, 2024
8e5f06b
Note that backpressure is obeyed for writable
riceaJan 23, 2024
5cb355b
Remove mention of passing close code or reason to abort() or cancel()
riceaJan 23, 2024
1f9a2d6
Revert "Remove mention of passing close code or reason to abort() or …
riceaJan 28, 2024
96baeed
Mention that it has to be a WebSocketError
riceaJan 28, 2024
69bae4f
Add IDL for WebSocketError
riceaJan 28, 2024
fa5ff83
Add algorithm steps for WebSocketStream and WebSocketError
riceaJan 28, 2024
adf4bbe
Changes from reviews
riceaJan 30, 2024
f488ee4
Add missing AbortSignal algorithm steps.
riceaJan 30, 2024
b1a58f4
Use Bikeshed magic to get a URL record
riceaJan 31, 2024
8cc184c
Add missing colon
riceaJan 31, 2024
7812163
Remove "the user agent must run..."
riceaJan 31, 2024
47ab0da
Fix capitalisation of "close"
riceaJan 31, 2024
2b9ee80
Server can't send a bad reason, and wording improvement (by @domenic)
riceaJan 31, 2024
12ff404
Editorial changes from @domenic. Also change `closeCode` to [EnforceR…
riceaJan 31, 2024
a2fc7c2
Change `|this|` to `[=this=]` everywhere
riceaJan 31, 2024
3a285c7
Fix initialization of dictionaries and WebSocketErrors
riceaJan 31, 2024
397dd00
Demote "Feedback from the protocol" and "The CloseEvent interface"
riceaJan 31, 2024
9e8d8f7
Indent "Garbage Collection" and fix the WebSocketStream interface ena…
riceaFeb 1, 2024
673ace9
Use "queue a global task"
riceaFeb 6, 2024
30f5f8b
Explicitly say what realm write algorithm's promise is created in
riceaFeb 6, 2024
7d85772
Add more <hr>s
riceaFeb 6, 2024
1d7d868
Place The WebSocket Protocol in <cite> tags
riceaFeb 6, 2024
7b81f79
Fix many small nits from domenic@'s review
riceaFeb 6, 2024
6da74e7
Add a missing comma
riceaFeb 21, 2024
16a75fe
Fix description of "was ever connected"
riceaFeb 21, 2024
2bd7ad5
Fix grammar in developer notes
riceaFeb 21, 2024
b2e001c
Apply cleanups by @domenic.
riceaFeb 21, 2024
1e2eae9
Fixes requested by @domenic
riceaFeb 21, 2024
24f24f8
Fix Bikeshed compile error
riceaFeb 21, 2024
a6d426f
Set defaults for WebSocketError's closeCode and reason
riceaFeb 21, 2024
d5570f3
Add default arguments
riceaMar 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Fixes requested by@domenic
  • Loading branch information
@ricea
ricea committedFeb 21, 2024
commit1e2eae9549b16ea5f6f1445313da7f62f28addb8
20 changes: 11 additions & 9 deletionsindex.bs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -991,18 +991,18 @@ and data |data|, the user agent must [=queue a global task=] on the [=WebSocket
1. [=ReadableStream/Enqueue=] |chunk| into |stream|'s [=WebSocketStream/readable stream=].
1. Apply backpressure to the WebSocket.

<p class=note>Applying backpressure<span class=allow-2119>should</span>result in no new WebSocket
messages being handled untilthe backpressure is released. After an implementation-defined amount
of data is buffered, theclient will stop reading from the underlying network connection resulting
in network-layerbackpressure being applied.
<p class=note>Applying backpressurewillresult in no new WebSocket messages being handled until
the backpressure is released. After an implementation-defined amount of data is buffered, the
client will stop reading from the underlying network connection resulting in network-layer
backpressure being applied.
</div>

<hr>

When [=the WebSocket closing handshake is started=] for a {{WebSocketStream}}
|stream|, the user agent must [=queue a global task=] on the [=WebSocket task source=] given
|stream|'s [=relevant global object=] to change |stream|'s [=WebSocketStream/ready state=] to
{{WebSocket/CLOSING}}if it is not already.[[!WSP]]
{{WebSocket/CLOSING}} [[!WSP]]

<hr>

Expand DownExpand Up@@ -1061,14 +1061,16 @@ To <dfn>cancel</dfn> a {{WebSocketStream}} |stream| given |reason|, [=close usin

To <dfn>write</dfn> |chunk| to a {{WebSocketStream}} |stream|:
1. Let |promise| be [=a new promise=] created in |stream|'s [=relevant realm=].
1. Let |data| be null.
1. Let |opcode| be null.
1. If |chunk| is a {{BufferSource}},
1.Let |data|be a [=get a copy of the buffer source|copy of the bytes=] given |chunk|.
1.Let |opcode|be a binary frame opcode.
1.Set |data|to a [=get a copy of the buffer source|copy of the bytes=] given |chunk|.
1.Set |opcode|to a binary frame opcode.
1. Otherwise,
1. Let |string| be the result of [=Converted to an IDL value|converting=] |chunk| to an IDL
{{USVString}}. If this throws an exception, return [=a promise rejected with=] the exception.
1.Let |data|be the result of [=UTF-8 encoding=] |string|.
1.Let |opcode|be a text frame opcode.
1.Set |data|to the result of [=UTF-8 encoding=] |string|.
1.Set |opcode|to a text frame opcode.
1. In parallel,
1. Wait until there is sufficient buffer space in |stream| to send the message.

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp