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

Replace sendDatagrams()/receiveDatagrams() methods with attributes? #54

Closed
pthatcherg opened this issue Sep 13, 2019 · 5 comments · Fixed by #135
Closed

Replace sendDatagrams()/receiveDatagrams() methods with attributes? #54

pthatcherg opened this issue Sep 13, 2019 · 5 comments · Fixed by #135

Comments

@pthatcherg
Copy link
Contributor

Was there as good reason for having them be methods? I can't remember any good reason. It might be nice to match WebSocketConnection which has .readable and .writable.

But in that case we might want .datagrams.readable and .datagrams.writable instead of .receivedDatagrams and .datagramsToSend (or similar).

@pthatcherg pthatcherg changed the title Replace sendDatagrams/receiveDatagrams methods with attributes? Replace sendDatagrams()/receiveDatagrams() methods with attributes? Sep 13, 2019
@ricea
Copy link
Contributor

ricea commented Oct 21, 2019

Currently it appears that the transport will ignore any incoming datagrams until receiveDatagrams() is called. That would change if you replaced it with an attribute. However, it's not clear this facility is useful anyway.

@Jxck
Copy link

Jxck commented Jun 24, 2020

it seems natural that sendXX() has xx as argument. in this case sendDatagram(datagram) and also for receiveX() returns x so datagram = receiveDatagram()

but current spec, sendDatagram() and receiveDatagras() returns stream.

interface mixin DatagramTransport {
    readonly attribute unsigned short maxDatagramSize;
    WritableStream sendDatagrams();
    ReadableStream receiveDatagrams();
};

if thease behave like a getter or creator, their name should be getSomething() or createSomething() which returns something.

@yutakahirano
Copy link
Contributor

Currently it appears that the transport will ignore any incoming datagrams until receiveDatagrams() is called. That would change if you replaced it with an attribute. However, it's not clear this facility is useful anyway.

Is this still correct? Currently receiveDtagarams() just returns the value of the corresponding internal slot.

Reg: naming how about readableDatagarams and writableDatagarms? I prefer attributes to methods too.

@vasilvv
Copy link
Contributor

vasilvv commented Jul 6, 2020

I think readableDatagarams and writableDatagarms is nice because it would make it consistent with how the streams have readable and writable.

@Jxck Jxck mentioned this issue Jul 7, 2020
@aboba
Copy link
Collaborator

aboba commented Sep 24, 2020

@pthatcherg sendDatagrams()/receiveDatagrams() predated the switch to WHATWG Streams, and they no longer make sense. Better alignment between WebSocketStreams API and WebTransport (particularly if WebSocketStreams will also support QUIC datagrams) is also a good thing.

vasilvv added a commit to vasilvv/web-transport that referenced this issue Sep 25, 2020
This turns all getter methods for ReadableStreams and WritableStreams
into attirubtes, and renames some of them for clarity.

Fixes w3c#54, w3c#101, w3c#132.
vasilvv added a commit to vasilvv/web-transport that referenced this issue Sep 25, 2020
This turns all getter methods for ReadableStreams and WritableStreams
into attirubtes, and renames some of them for clarity.

Fixes w3c#54.
Fixes w3c#101.
Fixes w3c#132.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants