JRedisAsynchClient connection lost

2 views
Skip to first unread message

waterye

unread,
Apr 12, 2010, 4:28:44 AM4/12/10
to JRedis
i use JRedisAsynchClient in my applicaton, but sometimes connection
lost

ConnectionSpec cs = DefaultConnectionSpec.newSpec();
InetAddress ia = InetAddress.getByName(addr);
cs.setSocketFlag(ConnectionSpec.SocketFlag.SO_KEEP_ALIVE,
true);
cs.setReconnectCnt(3);

cs.setSocketProperty(DefaultConnectionSpec.SocketProperty.SO_PREF_BANDWIDTH,
0);

cs.setSocketProperty(DefaultConnectionSpec.SocketProperty.SO_PREF_CONN_TIME,
2);

cs.setSocketProperty(DefaultConnectionSpec.SocketProperty.SO_TIMEOUT,
3000);

cs.setSocketProperty(DefaultConnectionSpec.SocketProperty.SO_PREF_LATENCY,
1);

cs.setSocketProperty(DefaultConnectionSpec.SocketProperty.SO_RCVBUF,
1024 * 128); // // set RCV buffer to 128KB

cs.setSocketProperty(DefaultConnectionSpec.SocketProperty.SO_SNDBUF,
1024 * 128); // // set SND buffer to 128KB
cs.setAddress(ia);
cs.setPort(port);
cs.setCredentials("pwd".getBytes());
cs.setDatabase(0);

jRedisFuture = new JRedisAsynchClient(cs);

Joubin Houshyar

unread,
Apr 12, 2010, 11:00:36 AM4/12/10
to JRedis
Hi,

Not sure what the issue is based on what you posted. [I am assuming
you are using the latest jars or source from master (?)]

That said, the JRedisAsynch client is perhaps the least developed/
tested of the connectors. (It'll probably get phased out in for Redis
2.0.) Try JRedisPipeline which has the same Future semantics.
Regardless, if you have more details it would be helpful.

/R

waterye

unread,
Apr 12, 2010, 9:02:43 PM4/12/10
to JRedis
thanks

jRedisFuture.incr(pvKey);

sometimes this code not +1, connected_clients count reduce

Reply all
Reply to author
Forward
0 new messages