News for hackers. Stuff that matters.
Re:QuakeJS – A Quake Port to JavaScript with Emscripten by johnsolo1701 on Monday April 06, 2020 @07:25PM (#22798924)
My understanding is that action-oriented multiplayer games in browsers have always suffered because they can't use UDP. How does this achieve multiplayer from a networking perspective?
Re:QuakeJS – A Quake Port to JavaScript with Emscripten by Sean-Der on Monday April 06, 2020 @08:10PM (#22799183)
Lots of people use WebRTC DataChannels for this! The real tech here is SCTP, and it is pretty amazing. It runs over UDP, and allows you to send messages larger than MTU. You can also choose ordered/unordered and lossy/non-lossy depending on what you are trying to do.

We worked on a Pure Go implementation[0]. If you are interested in learning more. Most people (all browsers) use libusrsctp the C implementation.

[0] https://github.com/pion/sctp

Re:QuakeJS – A Quake Port to JavaScript with Emscripten by mike_d on Monday April 06, 2020 @07:46PM (#22799049)
HTTP/2 with stream prioritization and server push kinda replaces the need for UDP.

We can't allow UDP to be sent directly from browsers because that would enable any random bit of JavaScript you load to launch a DDoS attack.

Re:QuakeJS – A Quake Port to JavaScript with Emscripten by klodolph on Monday April 06, 2020 @08:08PM (#22799171)
HTTP/2 doesn’t replace the need for UDP at all, not in the slightest. For latency-sensitive applications, it provides no advantages over HTTP that I can tell.

The problem is with TCP, and the problem with TCP is that it prioritizes in-order delivery, and missed packets cause head of line blocking. HTTP/2 is designed to solve head of line blocking, but since it’s built on top of TCP, it can’t solve the issue in this case.

Re:QuakeJS – A Quake Port to JavaScript with Emscripten by mypalmike on Monday April 06, 2020 @08:13PM (#22799199)
UDP was never "needed". It's been used in real-time applications because there are latency benefits to datagram protocols.

And browsers can indeed use UDP. WebRTC data channels are SCTP over DTLS, which is UDP based.

Re:QuakeJS – A Quake Port to JavaScript with Emscripten by leowoo91 on Monday April 06, 2020 @07:28PM (#22798953)