We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
用telnet连接真正的reids时 直接输入 ping 就会返回+pong 但是我按照您的第二章(Golang 实现 Redis(2): 实现 Redis 协议解析器) 实现的demo中 必须用先输入一个 *1 回车
` ➜ src telnet 127.0.0.1 8000
Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. *1 ping +PONG `
连接真实的redis服务: ` Trying 127.0.0.1...
Connected to localhost. Escape character is '^]'. ping +PONG `
请问产生这个区别的原因是 redis用的空格来截取cmd 而您的例子是用的\n 吗? 为什么您的例子不也使用空格呢?
The text was updated successfully, but these errors were encountered:
和这一段 必须先取一下 * 开头的变量也有关系 但真正的redis 并不需要先输入* 。应该是这点区别吧 ` if !client.sending.Get() { if msg[0] == '*' { expectedLine, err := strconv.ParseUint(string(msg[1:len(msg)-2]), 10, 32) if err != nil { client.conn.Write([]byte("=====UnknownErrReplyBytes" + err.Error())) continue } client.waitingReply.Add(1) client.sending.Set(true) client.expectedArgsCount = uint32(expectedLine) client.receivedCount = 0 client.args = make([][]byte, expectedLine) } else { //TODO text protocol } }
`
Sorry, something went wrong.
哦哦 我理解错了。后面有解决的方式~~~ 打扰了 大神
No branches or pull requests
用telnet连接真正的reids时 直接输入 ping 就会返回+pong
但是我按照您的第二章(Golang 实现 Redis(2): 实现 Redis 协议解析器)
实现的demo中
必须用先输入一个 *1 回车
`
➜ src telnet 127.0.0.1 8000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
*1
ping
+PONG
`
连接真实的redis服务:
`
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
ping
+PONG
`
请问产生这个区别的原因是 redis用的空格来截取cmd 而您的例子是用的\n 吗?
为什么您的例子不也使用空格呢?
The text was updated successfully, but these errors were encountered: