<html><head></head><body bgcolor="#FFFFFF"><div><br><br><br></div><div><br>Le 27 déc. 2013 à 08:40, Celogeek San &lt;<a href="mailto:me@celogeek.com">me@celogeek.com</a>&gt; a écrit&nbsp;:<br><br></div><div></div><blockquote type="cite"><div><p dir="ltr">Hi. What happen in case of read timeout?<br>
Did you close the connexion?</p>
<p dir="ltr">If I read a data with a very long time to response.<br>
So I have a read time out.<br>
And then I do another command.<br>
It is possible if the socket had not been flush to receive the precedent command</p></div></blockquote><div>Yes indeed. Contrary to a previous implementation ( where the socket was closed for you), this implementation doesn't do anything for you on the socket. When a timeout is hit, Redis.pm throws an exception and $! Is set. You should then close the connection and retry.&nbsp;</div><div><br></div><div>In theory, if the timeout was hit while writing, you could retry with the same socket, because you can be reasonably &nbsp;site that the command didn't hit the server. However, I don't think Redis exceptions will make it clear if it was while reading or writing. There is a ticket on github to implement better exceptions.&nbsp;</div><div><br></div><br><blockquote type="cite"><div>
<div class="gmail_quote">Le 26 déc. 2013 23:28, "Damien Krotkine" &lt;<a href="mailto:damien@krotkine.com">damien@krotkine.com</a>&gt; a écrit :<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I've just pushed new code in the git master branch. It contains timeouts<br>
related features. Now you can creates a Redis client with connection,<br>
read and write timeouts:<br>
<br>
my $redis = Redis-&gt;new(<br>
&nbsp; &nbsp; cnx_timeout =&gt; 60, &nbsp; &nbsp; &nbsp;# connection timeout (in seconds)<br>
&nbsp; &nbsp; read_timeout =&gt; 0,5, &nbsp; &nbsp;# read timeout (in seconds)<br>
&nbsp; &nbsp; write_timeout =&gt; 1.2, &nbsp; &nbsp;# write timeout (in seconds)<br>
);<br>
<br>
I haven't yet released it on CPAN, I'd like to do a developer release<br>
first (but I'm not sure how to do that with dzil). Anyway please feel<br>
free to test it and let me know of any issues. The code uses 2<br>
strategies, on mac and linux it uses setsockopt to set read / write<br>
timeouts, on other OS it uses 'select'. I plan to extend the setsockopt<br>
strategies to more OS.<br>
<br>
dams.<br>
<br>
<br>
_______________________________________________<br>
Redis mailing list<br>
<a href="mailto:Redis@lists.scsys.co.uk">Redis@lists.scsys.co.uk</a><br>
<a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/redis" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/redis</a><br>
</blockquote></div>
</div></blockquote></body></html>