zhangmeng
2022-01-14 f7c4658c884629e79a9ce98052e19f8a68abdf22
performance
2个文件已修改
74 ■■■■ 已修改文件
src/bn_api.cpp 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/interface_bus_api.cpp 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/bn_api.cpp
@@ -131,15 +131,15 @@
    auto url(get_url(URLQueryTopic));
    if (remote && remote_len > 0){
        BHAddress addr;
        if (addr.ParseFromArray(remote, remote_len)){
            if (!addr.ip().empty() && addr.port() > 0){
                // url = "tcp://" + addr.ip() + ":" + to_string(addr.port());
                printf("======>> BHQueryTopicAddress use remote address %s\n", url.c_str());
            }
        }
    }
    // if (remote && remote_len > 0){
    //     BHAddress addr;
    //     if (addr.ParseFromArray(remote, remote_len)){
    //         if (!addr.ip().empty() && addr.port() > 0){
    //             // url = "tcp://" + addr.ip() + ":" + to_string(addr.port());
    //             printf("======>> BHQueryTopicAddress use remote address %s\n", url.c_str());
    //         }
    //     }
    // }
    return simple_request(url, topic, topic_len, reply, reply_len, timeout_ms);
}
@@ -157,15 +157,15 @@
    auto url(get_url(URLQueryProcs));
    if (remote && remote_len > 0){
        BHAddress addr;
        if (addr.ParseFromArray(remote, remote_len)){
            if (!addr.ip().empty() && addr.port() > 0){
                // url = "tcp://" + addr.ip() + ":" + to_string(addr.port());
                printf("======>> BHQueryProcs use remote address %s\n", url.c_str());
            }
        }
    }
    // if (remote && remote_len > 0){
    //     BHAddress addr;
    //     if (addr.ParseFromArray(remote, remote_len)){
    //         if (!addr.ip().empty() && addr.port() > 0){
    //             // url = "tcp://" + addr.ip() + ":" + to_string(addr.port());
    //             printf("======>> BHQueryProcs use remote address %s\n", url.c_str());
    //         }
    //     }
    // }
    return simple_request(url, query, query_len, reply, reply_len, timeout_ms);
}
src/interface_bus_api.cpp
@@ -41,7 +41,7 @@
        subscribe_center(url_sub_queue, &get<2>(*b));
        // temporary
        port = 0;
        // port = 0;
        start_reply(get<8>(*b), port, &get<6>(*b));
        return b;
@@ -133,15 +133,15 @@
    auto url(get_url(URLQueryTopic));
    if (remote && remote_len > 0){
        BHAddress addr;
        if (addr.ParseFromArray(remote, remote_len)){
            if (!addr.ip().empty() && addr.port() > 0){
                // url = "tcp://" + addr.ip() + ":" + to_string(addr.port());
                printf("======>> bus_query_topic_address use remote address %s\n", url.c_str());
            }
        }
    }
    // if (remote && remote_len > 0){
    //     BHAddress addr;
    //     if (addr.ParseFromArray(remote, remote_len)){
    //         if (!addr.ip().empty() && addr.port() > 0){
    //             // url = "tcp://" + addr.ip() + ":" + to_string(addr.port());
    //             printf("======>> bus_query_topic_address use remote address %s\n", url.c_str());
    //         }
    //     }
    // }
    return simple_request(url, topics, topics_len, reply, reply_len, timeout_ms);
}
@@ -167,15 +167,15 @@
    auto url(get_url(URLQueryProcs));
    if (remote && remote_len > 0){
        BHAddress addr;
        if (addr.ParseFromArray(remote, remote_len)){
            if (!addr.ip().empty() && addr.port() > 0){
                // url = "tcp://" + addr.ip() + ":" + to_string(addr.port());
                printf("======>> bus_query_procs use remote address %s\n", url.c_str());
            }
        }
    }
    // if (remote && remote_len > 0){
    //     BHAddress addr;
    //     if (addr.ParseFromArray(remote, remote_len)){
    //         if (!addr.ip().empty() && addr.port() > 0){
    //             // url = "tcp://" + addr.ip() + ":" + to_string(addr.port());
    //             printf("======>> bus_query_procs use remote address %s\n", url.c_str());
    //         }
    //     }
    // }
    return simple_request(url, query, query_len, reply, reply_len, timeout_ms);
}