#include #include #include #include "proto/service.pb.h" #include "proto/mvlc.pb.h" #include #include "internal/argh.h" using namespace mesytec; using namespace std::literals; void print_service_descriptors(google::protobuf::Service &service) { auto sd = service.GetDescriptor(); spdlog::info("service: full_name={}, index={}, method_count={}", sd->full_name(), sd->index(), sd->method_count()); for (int i = 0; i < sd->method_count(); ++i) { auto md = sd->method(i); auto it = md->input_type(); auto ot = md->output_type(); spdlog::info(" method: full_name={}, index={}, input_type={}, output_type={}", md->full_name(), md->index(), it->full_name(), ot->full_name()); } } int main() { namespace nng = mnode::nng; spdlog::set_level(spdlog::level::debug); mnode::PingService_Stub pingService(nullptr); print_service_descriptors(pingService); mnode::vme::VmeAccess_Stub vmeService(nullptr); print_service_descriptors(vmeService); mnode::mvlc::MVLC_Stub mvlcService(nullptr); print_service_descriptors(mvlcService); auto socket = nng::make_rep_socket(); if (int res = nng_listen(socket, "tcp://localhost:5555", nullptr, 0)) { nng::mnode_nng_error("nng_listen", res); return res; } return 0; }