acl-dev / acl

C/C++ server and network library, including coroutine,redis client,http/https/websocket,mqtt, mysql/postgresql/sqlite client with C/C++ for Linux, Android, iOS, MacOS, Windows, etc..
https://acl-dev.cn
GNU Lesser General Public License v3.0
2.88k stars 936 forks source link

win10,程序开启自启,连接Redis时阻塞(偶现) #256

Open smartCharle opened 2 years ago

smartCharle commented 2 years ago
        pool_.reset(new acl::redis_client_pool(addr, maxConn)); 
            if (!pool_->aliving())
    {
        acl_msg_error("pool not aliving");
        return false;
    }

    acl_msg_info("%s: created pool", __FUNCTION__);

    if(param_.connTimeout_ > 0 && param_.reqTimeout_ > 0)
    {
        acl_msg_info("%s: set timeout %d,%d", __FUNCTION__, param_.connTimeout_, param_.reqTimeout_);
        pool_->set_timeout(param_.connTimeout_, param_.reqTimeout_);
    }

    auto client = pool_->peek();
    if(nullptr == client)
    {
        acl_msg_error("error peek client");
        return false;
    }
    acl_msg_info("peeked client");
zhengshuxin commented 2 years ago

建立使用 redis_client_cluster 做为通信类试一下。