MOZGIII / xwt

A unified WebTransport API that you can use for browser/native cross platform apps. Originally to power the networking layer of the games made with the bevy engine - but can be applied elsewhere too.
31 stars 4 forks source link

Incomplete chunk reading/writing for streams #150

Closed poshcoe closed 3 months ago

poshcoe commented 4 months ago

Hi,

Thanks for making this library! I've been using xwt while developing a small WASM/native app and it's saved me a lot of time.

I see that there has been a start on supporting chunked reading/writing with the ReadChunk and WriteChunk traits in xwt-core, but it seems these are not implemented anywhere as of yet. (Am I missing something?)

What are the blockers for implementation of these traits within xwt-web-sys and xwt-wtransport?

I may be able to lend a hand.

MOZGIII commented 4 months ago

I think it is implemented for xwt-wtransport but not for xwt-web-sys.

You should be able to use it today by applying additional requirements to the traits. It won't work with xwt-web-sys today though.

I am not sure if this can even be implemented for xwt-web-sys - need to investigate. Any help is appreciated.

MOZGIII commented 4 months ago

I have checked, and it does not looks like the chunk reading/writing APIs can be implemented with the web APIs.

There is an API for atomic writes - but that is a different thing, and is not quite the same.


Note that chunks API is not a replacement for data framing - if you need to send data packets over the streams I suggest adding framing manually on top of the regular stream read/write APIs.