Skip to content

send() could be more precise #71

@domenic

Description

@domenic

What is the issue with the WebSockets Standard?

Consider code such as the following:

const bytes = new Uint8Array([0x01]);
webSocket.send(bytes);
bytes[0] = 0x02;

Is 0x01 sent, or 0x02?

What about

const bytes = new Uint8Array([0x01]);
webSocket.send(bytes);
bytes.buffer.transfer();

?

Probably the desired answer is that we snapshot the bytes the moment they are fed to the send() method? If so, the spec should use https://webidl.spec.whatwg.org/#dfn-get-buffer-source-copy to be explicit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions