简体   繁体   English

如何在C ++ GRPC客户端中创建到一个特定地址的多个连接

[英]How to create multiple connection to one specific address in C++ GRPC client

I wrote a c++ grpc client, and wanted to create multiple connection by create multiple channel, just like the hello world example . 我编写了一个c ++ grpc客户端,并希望通过创建多个通道来创建多个连接,就像hello world 示例一样

But only one connection for the specific address was created. 但是,只为该特定地址创建了一个连接。 So how to create multiple connection to the server? 那么如何建立与服务器的多重连接呢?

Honestly, I don't see significant reasons for that (at least for basic use cases). 坦率地说,我没有看到重要的原因(至少对于基本用例而言)。 You don't need to create multiple connections to have some kind of connection pooling (as you might want to do while connecting to RDBMS like PostgreSQL). 您无需创建多个连接即可拥有某种类型的连接池(就像在连接到PostgreSQL之类的RDBMS时可能想要做的那样)。 The bandwidth of physical transport (TCP connection) will be fully utilized by the single network connection. 单个网络连接将充分利用物理传输(TCP连接)的带宽。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM