3 ms·
I wonder why "\r\n" and not just "\n" is the string separator in RESP. I get that it needs to be human readable but \n should be enough to make it readable in a
by laurent123456 12y ago
I wonder why "\r\n" and not just "\n" is the string separator in RESP. I get that it needs to be human readable but \n should be enough to make it readable in any text viewer. Or is there something more to it?
- benmanns 12y agoI was wondering the same thing. Perhaps "\r\n" is more friendly to Windows or Telnet users?
- ominous_prime 12y agoProbably only because CRLF is sort of the network line ending standard, used in many common protocols like http, imap, smtp, etc.
- pkulak 12y agoI wonder why errors and simple strings aren't just length-delimited as well. What do you gain by having both methods in one protocol?
- Zikes 12y agoI think human readability was something antirez really wanted, and having explicit line delimeters would make it easy to visually parse in a telnet session or building/debugging a client.
- sunseb 12y agoIt's similar to HTTP chunked transfer encoding : http://en.wikipedia.org/wiki/Chunked_transfer_encoding http://en.wikipedia.org/wiki/Chunked_transfer_encoding And why did they choose these prefix chars ($, *, +, -) ?