3 ms·
> message oriented Very well said. I think there is enormous complexity in many layers because we don't have that building block easily available.
by calineczka 10mo ago
> message oriented
Very well said. I think there is enormous complexity in many layers because we don't have that building block easily available.
- mort96 10mo agoIt's the main reason why I use websockets for a whole lot of things. I don't wanna build my own message chunking layer on top of TCP every time.
- mgaunard 10mo agoWebSocket is full of web-tech silliness; you'd be better off doing your own framing.
- mort96 10mo agoWell, it also has the advantage of providing pretty decent encryption for free through WSS. But yeah, where that's unnecessary, it's probably just as easy to have a 4-byte length prefix, since TCP handles the checksum and retransmit and everything for you.
- mgaunard 10mo agoIt's just a standard TLS layer, works with any TCP protocol, nothing WebSocket-specific in it. You should ideally design your messages to fit within a single Ethernet packet, so 2 bytes is more than enough for the size. Though I have sadly seen an increasing amount of developers send arbitrarily large network messages and not care about proper design.
- mort96 10mo agoMeh I've worked enough with OpenSSL's API to know that I never ever want to implement SSL over TCP myself. Better let the WebSocket library take care of it.