joelcox / codeigniter-redis

A CodeIgniter library to interact with Redis
MIT License
240 stars 142 forks source link

Fixed intermittent part of the large packet is lost #29

Closed crazykooler closed 11 years ago

crazykooler commented 11 years ago

in __construct() function

$this->_connection = @fsockopen($this->_ci->config->item('redis_host'), $this->_ci->config->item('redis_port'), $errno, $errstr, 3);

to

$this->_connection = @stream_socket_client("tcp://".$this->_ci->config->item('redis_host').":".$this->_ci->config->item('redis_port'), $errno, $errstr, 3);

and in _bulk_reply() function

private function _bulk_reply()
{
    $value_length = (int) fgets($this->_connection);

    if($value_length > 0 && $this->_connection) {
        return fgets($this->_connection, $value_length + 1);
    }
}
joelcox commented 11 years ago

Hey Kim,

Thanks for opening this issue. Really curious if this helps with #17 at all.

Joël

On Feb 22, 2013, at 8:19 AM, Kim Chanhwi notifications@github.com wrote:

in __construct() function

$this->_connection = @fsockopen($this->_ci->config->item('redis_host'), $this->_ci->config->item('redis_port'), $errno, $errstr, 3); to

$this->_connection = @stream_socket_client("tcp://".$this->_ci->config->item('redis_host').":".$this->_ci->config->item('redis_port'), $errno, $errstr, 3); and in _bulk_reply() function

private function _bulk_reply() { $value_length = (int) fgets($this->_connection);

if($value_length > 0 && $this->_connection) {
    return fgets($this->_connection, $value_length + 1);
}

} — Reply to this email directly or view it on GitHub.

crazykooler commented 11 years ago

Thanks your stuff :) :+1: I think there is a better way for me, I will help this But, this solve everything related to the stream_socket_client created

joelcox commented 11 years ago

Hi Kim,

I'm really sorry that I haven't looked into this yet. I reserved some time later this week to look into your suggestions.

Joël

On Feb 25, 2013, at 5:20 PM, Kim Chanhwi notifications@github.com wrote:

But i thnik this solve everything, be stream_socket_client created

— Reply to this email directly or view it on GitHub.

joelcox commented 11 years ago

I added your changes but this doesn't seem to fix #17.

https://github.com/joelcox/codeigniter-redis/tree/issue-29 https://travis-ci.org/joelcox/codeigniter-redis/jobs/5534631

joelcox commented 11 years ago

Hi Kim, care to pitch in on these changes?

swznd commented 11 years ago

sorry, I didn't read this first. it may be duplicate with my new pull request #34

joelcox commented 11 years ago

Fixed in #34.