zhangmeng
2022-01-13 b379104205af838e883a252e9b8358b0388e6015
src/nng_wrap.cpp
@@ -209,12 +209,12 @@
            if (m_len > 0){
                string tmp_msg{m, (size_t)m_len};
                nn_freemsg(m);
                auto topic{tmp_msg.c_str()};
                const auto topic{tmp_msg.c_str()};
                string msg{};
                {
                    lock_guard<mutex> l{(*sub)()};
                    for(auto && i : sub->topics_){
                        if (i.compare(topic) == 0){
                        if (!!!i.compare(topic)){
                            msg = move(tmp_msg.substr(i.size()+1));
                            break;
                        }
@@ -512,6 +512,7 @@
        get<1>(get<1>(rep->socks_)) = port;
        ipc = "tcp://0.0.0.0:" + to_string(port);
        if(create_server(&get<0>(get<1>(rep->socks_)), ipc, 62, rep) != 0) return -1;
        printf("======>> create server for remote port %d\n", port);
    }else {
        get<0>(get<1>(rep->socks_)).id = numeric_limits<int32_t>::max();
    }