memcache手动操作

这两天看了一下Memcache的手动操作,及与spring的集成。
当telnet服务器后,手动调用set命令,但是一直报CLIENT_ERROR_ bad data chunk,找了半天也没有查找出解决方法,最后看了一下Memcache的英文文档:才理解原因:

“Storage commands (there are three: "set", "add" and "replace") ask the
server to store some data identified by a key. The client sends a
command line, and then a data block; after that the client expects one
line of response, which will indicate success or faulure.”,
理解:
  我们在写set命令的时候,是先发送一个命令行,如set mykey 0 0 5,敲击回车,这个时候Memcache服务器会接收到这个命令,然后再客户端我们收入要存储的数据,在敲击回车,这个时候,服务器端才会存储该key对应的值。

猜你喜欢

转载自ch4539.iteye.com/blog/2159820