Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
beef9999 committed Oct 12, 2023
1 parent bb9de93 commit a0cbe3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions rpc/rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,9 @@ namespace rpc {

class StubPoolImpl : public StubPool {
public:
explicit StubPoolImpl(uint64_t expiration, uint64_t connect_timeout, uint64_t rpc_timeout) {
explicit StubPoolImpl(uint64_t expiration, uint64_t connect_timeout, uint64_t rpc_timeout, bool ipv6) {
tls_ctx = net::new_tls_context(nullptr, nullptr, nullptr);
tcpclient = net::new_tcp_socket_client_ipv6();
tcpclient = ipv6 ? net::new_tcp_socket_client_ipv6() : net::new_tcp_socket_client();
tcpclient->timeout(connect_timeout);
m_pool = new ObjectCache<net::EndPoint, rpc::Stub*>(expiration);
m_rpc_timeout = rpc_timeout;
Expand Down Expand Up @@ -489,7 +489,7 @@ namespace rpc {
public:
explicit UDSStubPoolImpl(const char* path, uint64_t expiration,
uint64_t connect_timeout, uint64_t rpc_timeout)
: StubPoolImpl(expiration, connect_timeout, rpc_timeout),
: StubPoolImpl(expiration, connect_timeout, rpc_timeout, false),
m_path(path), m_client(net::new_uds_client()) {
m_client->timeout(connect_timeout);
}
Expand All @@ -515,8 +515,8 @@ namespace rpc {
net::ISocketClient * m_client;
};

StubPool* new_stub_pool(uint64_t expiration, uint64_t connect_timeout, uint64_t rpc_timeout) {
return new StubPoolImpl(expiration, connect_timeout, rpc_timeout);
StubPool* new_stub_pool(uint64_t expiration, uint64_t connect_timeout, uint64_t rpc_timeout, bool ipv6) {
return new StubPoolImpl(expiration, connect_timeout, rpc_timeout, ipv6);
}

StubPool* new_uds_stub_pool(const char* path, uint64_t expiration,
Expand Down
3 changes: 2 additions & 1 deletion rpc/rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ namespace rpc
};

extern "C" Stub* new_rpc_stub(IStream* stream, bool ownership = false);
extern "C" StubPool* new_stub_pool(uint64_t expiration, uint64_t connect_timeout, uint64_t rpc_timeout);
extern "C" StubPool* new_stub_pool(uint64_t expiration, uint64_t connect_timeout, uint64_t rpc_timeout,
bool ipv6 = false);
extern "C" StubPool* new_uds_stub_pool(const char* path, uint64_t expiration,
uint64_t connect_timeout,
uint64_t rpc_timeout);
Expand Down

0 comments on commit a0cbe3c

Please sign in to comment.