3 ms·
I feel like when you start using protocol features you heard about from an RFC, you just get disappointed, because they never work as well as the author of the
by jrockway 8y ago
I feel like when you start using protocol features you heard about from an RFC, you just get disappointed, because they never work as well as the author of the RFC envisioned.
Certainly if you have two nodes both using software that you control, everything is going to be great. But that never happens. Someday, someone is going to want a load balancer in the middle. Does your favorite load balancer read the urgent flag in the TCP packet? Probably not. So now you are shaving that yak, or rewriting your app when you don't actually control the code (think cloud providers), wasting time and money because you read something you thought was "neat".
If you want records in your TCP connection, define the first n octets of your stream to be a record length. Read the length, then read that many octets off the stream. There's your record. The next n octets of the stream are the length of the next record... and so on. This will work with every TCP stack everywhere, forever. Done.
As for RFCs, I've recently been working on an aggregator for syslog messages. I read the RFC, and the protocol sounds quite nice, well-defined positions in the stream for all sorts of relevant data like the time, hostname, and even arbitrary structured data. Back in the real world, though, nobody read the RFC and a syslog message looks like "'<' <some numbers that are supposed to be the priority, but nobody can decide what the priority means so it's just some digits that you throw away> '>' <arbitrary bytes that have no standard meaning, sometimes there's something that looks like a timestamp or a hostname, but really trusting a device to know its own name is way too much to ask, and timestamps... don't get me started>". Sometimes the message ends with a \n, but I wouldn't count on it.
TL;DR: it's nice that you read the RFC. Too bad nobody else did.