This commit is contained in:
qicosmos
2025-10-01 20:18:18 +08:00
parent 21d9551aea
commit 139a8144a8
4 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -1,2 +1,2 @@
#include "rest_rpc/rpc_client.hpp"
#include "rest_rpc/rpc_server.h"
#include "rest_rpc/rest_rpc_client.hpp"
#include "rest_rpc/rest_rpc_server.h"
@@ -24,9 +24,9 @@ template <> struct call_result<void> {
rpc_errc ec;
};
class client {
class rest_rpc_client {
public:
client() : socket_(get_global_executor()) {}
rest_rpc_client() : socket_(get_global_executor()) {}
auto get_executor() { return socket_.get_executor(); }
+4 -4
View File
@@ -1,5 +1,5 @@
#include <iostream>
#include <rest_rpc/client.hpp>
#include <rest_rpc/rest_rpc_client.hpp>
#include <rest_rpc/rest_rpc_server.hpp>
using namespace rest_rpc;
@@ -13,7 +13,7 @@ std::string_view echo_sv(std::string_view str) {
return str;
}
asio::awaitable<void> bench(std::shared_ptr<client> cl) {
asio::awaitable<void> bench(std::shared_ptr<rest_rpc_client> cl) {
co_await cl->connect(address);
std::string_view str = "it is a test";
while (true) {
@@ -43,9 +43,9 @@ int main(int argc, char **argv) {
auto arg = argv[1];
int par = atoi(arg);
std::vector<std::shared_ptr<client>> clients;
std::vector<std::shared_ptr<rest_rpc_client>> clients;
for (int i = 0; i < par; i++) {
clients.push_back(std::make_shared<client>());
clients.push_back(std::make_shared<rest_rpc_client>());
}
for (size_t i = 0; i < par; i++) {
+2 -2
View File
@@ -2,7 +2,7 @@
#include "doctest/doctest.h"
#include <asio/any_completion_handler.hpp>
#include <rest_rpc/client.hpp>
#include <rest_rpc/rest_rpc_client.hpp>
#include <rest_rpc/rest_rpc_server.hpp>
#include <rest_rpc/traits.h>
@@ -192,7 +192,7 @@ TEST_CASE("test server start") {
server.set_check_conn_interval(std::chrono::seconds(1));
auto ec = server.async_start();
CHECK(!ec);
client cl;
rest_rpc_client cl;
static_assert(util::CharArrayRef<char const(&)[5]>);
static_assert(util::CharArray<const char[5]>);