zhangmeng
2021-12-15 93ca5ec2e377961d0a7825b6906ee72dfc78480a
bug fixed nn_recv
1个文件已修改
4 ■■■■ 已修改文件
src/nng_wrap.cpp 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/nng_wrap.cpp
@@ -235,8 +235,8 @@
            if (rc == (int)sndmsg.size()){
                char* tmp{};
                rc = nn_recv(pub_.socket_, &tmp, NN_MSG, 0);
                nn_freemsg(tmp);
                if (rc > 0){
                    nn_freemsg(tmp);
                    printf("======>> publish topic %s data length %lu\n", msg->topic_.c_str(), msg->data_.size());
                    lock_guard<mutex> l{pub_.mtx_msg_};
                    pub_.msg_.pop_front();
@@ -439,8 +439,8 @@
            char* tmp{};
            int rc = nn_recv(sock, &tmp, NN_MSG, 0);
            nn_freemsg(tmp);
            if (rc > 0){
                nn_freemsg(tmp);
                rc = nn_send(sock, msg.data(), msg.size(), 0);
                if (rc < 0){
                    PRNTVITAG("heartbeat survey failed");