3 ms·
Very nice readable article. Having dabbled with implementation a bit I agree with most of his points. The author complains about websockets being frame-based i
by tinco 14y ago
Very nice readable article. Having dabbled with implementation a bit I agree with most of his points.
The author complains about websockets being frame-based instead of stream-based, because he argues if he would want a frame-based system he could easily model it on top of it.
I think frames are awesome. It is easier to build a stream on top of frames than it is to build frames on top of a stream in my opinion (you don't need an extra protocol for starters). Besides that almost anything you would like to do can be expressed in frames, saving most of us a lot of headaches.
I would like to add that websockets are not the end-all answer for web-game programmers. It makes some stuff easier, and reduces some overhead, but it's still on TCP, meaning realtime multiplayer games are still as good as impossible to implement.
Sadly all the issues with proxies go for UDP and then some, so I don't think we'll see any ubiquitous browser UDP protocol anytime soon :(
- the_mitsuhiko 14y ago> I think frames are awesome. It is easier to build a stream on top of frames than it is to build frames on top of a stream in my opinion (you don't need an extra protocol for starters). Besides that almost anything you would like to do can be expressed in frames, saving most of us a lot of headaches. Maybe I'm just old fashioned but I really don't like the idea of frames forced onto me. I much rather get my data in small pieces and can already start processing data as it comes in than having something buffer up everything and then giving it me as a large chunk. Streaming json for instance over websockets is a lot harder than TCP directly.
- ishbits 14y agoIMO the built in framing is one of the things I really like about websockets. I'm sure it will become my transport of choice for non performance critical messaging even when a browser is not one of the peers.
- wmf 14y agoWebRTC is already there if you want UDP.
- christkv 14y agowell does it though ? Data channels seems to use SCTP over DTLS over UDP which would create a sudo "TCP" layer on top of the UDP layer as I understood it :(.
- tinco 14y agoSCTP? That's awesome, I happened to have written an SCTP implementation for my BSc final project and it's a great protocol that makes in-order-delivery optional so it's a great replacement for UDP. edit: I hadn't heard of WebRTC at all, it looks like a dream come true, not only does it offer SCTP, it offers P2P in the browser, which I believe is going to enable Web 3.0 (yes I'll go there). Sadly they haven't even begun on implementing the Data Channels yet, which is the SCTP part of the spec.
- christkv 14y agoI hope ordered messages will be optional. For gaming and analytics out of order udp is a good enough tradeoff for the better "latency" of not doing acks. The p2p stuff is awesome.
- Negitivefrags 14y agoMy issue with it is that TCP is already a stream based protocol on top of a frame based protocol. This is a frame based protocol on a stream based protocol on a frame based protocol. Now if you want a stream based protocol you would need to add another layer on top of that. Madness.