Closed coanor closed 10 years ago
Hi @coanor,
First of all you should make sure that the timeout
value is set to 0
on your Redis server (see redis.conf) or it will drop any client idling for more than the specified value (not-so-old versions of Redis had a default timeout of 300 seconds AFAIR, now the default is 0).
On the client end you must create the connection by setting the timeout
parameter to 0
like in the following snippet to prevent the socket from being closed for a timeout when there's no activity:
local redis = require 'redis'
local client = redis.connect({ host = '127.0.0.1', timeout = 0 })
I use
redis_connect(ip, port)
to connect the Redis server(long time connection), then it works well, but about 10 minutes later,the connection is closed(active or passive, I don't know)And all the successive command are failed. I have browsed the out put of
CLIENT LIST
, and not list my client's IP, why this happened?