From 32fd5edc6c785062e0678dbc8d246b1d7cc87809 Mon Sep 17 00:00:00 2001 From: Coldwings Date: Thu, 5 Sep 2024 09:44:38 +0800 Subject: [PATCH] fix typo and make stub call timeout parameter using Timeout instead of uint64 --- rpc/rpc.cpp | 2 +- rpc/rpc.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rpc/rpc.cpp b/rpc/rpc.cpp index 570f1d90..85d1ba45 100644 --- a/rpc/rpc.cpp +++ b/rpc/rpc.cpp @@ -419,7 +419,7 @@ namespace rpc { class StubPoolImpl : public StubPool { public: - explicit StubPoolImpl(uint64_t expiration, int64_t connect_timeout, uint64_t transfer_timeout) { + explicit StubPoolImpl(uint64_t expiration, uint64_t connect_timeout, uint64_t transfer_timeout) { tls_ctx = net::new_tls_context(nullptr, nullptr, nullptr); tcpclient = net::new_tcp_socket_client(); tcpclient->timeout(connect_timeout); diff --git a/rpc/rpc.h b/rpc/rpc.h index 791c57b2..e4419a95 100644 --- a/rpc/rpc.h +++ b/rpc/rpc.h @@ -59,7 +59,7 @@ namespace rpc /** * @param req Request of Message * @param resp Response of Message - * @param timeout timeout in milliseconds, -1UL for no timeout + * @param timeout RPC timeout, counting from sending request to receiving response header * @return The number of bytes received, -1 for failure * @note Request and Response should assign to external memory buffers if they have variable-length fields. * Via this, we can achieve zero-copy send and receive. @@ -70,7 +70,7 @@ namespace rpc template int call(typename Operation::Request& req, typename Operation::Response& resp, - uint64_t timeout = -1UL) + Timeout timeout = {}) { SerializerIOV reqmsg; reqmsg.serialize(req);