D alternative for node.js's socket.IO?

Neia Neutuladh neia at ikeran.org
Mon Oct 22 03:59:44 UTC 2018


On Sun, 21 Oct 2018 23:05:06 -0400, Nick Sabalausky (Abscissa) wrote:
> I'm afraid I'm not familiar with socket.io, and the homepage doesn't
> seem to tell me much (it doesn't even say whether it uses TCP or UDP).
> But that said, in D, the gold-standard for pretty much *anything*
> related to networking and sockets is Vibe.D: http://vibed.org/

socket.io is a mix of XMLHttpRequest, websockets, and maybe long polling, 
based on HTTP of course. It's all Javascript, designed for a browser as a 
client and Node.js as a server.

When socket.io was first created, websockets were *relatively* new, and a 
lot of Windows/IE users were still on IE8/9, so it probably made a fair 
bit of sense to use a tool that could provide okay-ish support for all 
browsers and better support for newer browsers. But there's little reason 
to use it today.

The docs leave much to be desired.

> For a realtime multiplayer games though, that's notoriously a whole
> different can of worms. For that, you definitely do need UDP (which
> again, Vibe.D supports). But, UDP being what it is, you'd still need to
> design your program to handle UDP's inherently unguaranteed nature.
> Vibe.D doesn't have a gaming-oriented networking system built on top of
> UDP.

And since the person's probably communicating between browser clients, 
WebRTC is likely the most practical target there.

https://github.com/koldi/webrtc-dlang


More information about the Digitalmars-d mailing list