News for hackers. Stuff that matters.
Re:WebSockets vs. Server-Sent-Events vs. Long-Polling vs. We... by apitman on Tuesday March 19, 2024 @02:01PM (#39758548)
Yeah we're talking about different things. Imagine you had a process in the browser that can respond to many concurrent long-running requests from the server. In order to handle this with WebSockets, you need to implement your own multiplexing, because a) the server can't initiate a new WebSocket connection to the browser and b) opening a new WebSocket connect for each request doesn't fit the paradigm of request-response very well.

Note that WebTransport handles this for you, because the server can initiate new streams.

If you're sending lots of data, you also need per-stream backpressure.

There are no comments on this comment yet.