4 ms·
ASCII table codes 1,2,3 & 4 pretty simple to use.
by HumblyTossed 1y ago
ASCII table codes 1,2,3 & 4 pretty simple to use.
- dns_snek 1y agoSure, in principle. Someone already mentioned binary data, then you come up with a framing scheme and get to write protocol documentation, but why? What's the benefit?
- HumblyTossed 1y agoSimplicity.
- ryanjshaw 1y agoYou misspelled “bugs and maintenance nightmare”
- jcheng 1y agoNot if you're passing binary data
- woodruffw 1y agoEven beyond that: the ASCII delimiter control codes are perfectly valid UTF-8 (despite not being printable), so using them for in-band signaling is a recipe for pain on arbitrary UTF-8 data.
- mananaysiempre 1y agoIf you know your data is UTF-8, then bytes 0xFE and 0xFF are guaranteed to be free. Strictly speaking, 0xC0, 0xC1, and 0xF5 through 0xFD also are, but the two top values are free even if you are very lax and allow overlong encodings as well as codepoints up to 2³² − 1.
- woodruffw 1y agoI think it would probably be better to invest in a proper framing design than trying to poke holes in UTF-8. (This is true regardless of UTF-8 -- in-band encodings are almost always brittle!)
- tracker1 1y agoNow solve for encryption, authorization, authentication... WS(S) has in the box solutions for a lot of these... on top of that, application gateways, distribution, failover etc. You get a lot of already solved solutions in the box, so to speak. If you use raw sockets, now you have to implement all of these things yourself, and you aren't gaining much over just using WSS.
- HumblyTossed 1y ago"Now write an application that is so generic it solves every problem ever!" You don't always _need_ those things. Right? Right.