grpc serverport.pickunused-客户端如何连接?

发布于 2025-02-11 00:37:44 字数 270 浏览 1 评论 0 原文

建立GRPC的服务器端时,您可以指定它自动为您选择未使用的端口。但是,如果您使用此功能,那么客户将如何知道该端口的连接,因为它是动态的?

在我的特殊情况下,我将使用本地IPC,尽管我认为这个问题也可能与远程IPC有关。

When establishing the server-side of grpc you can specify that it automatically chooses an unused port for you. However, if you use this feature then how will the clients know which port to connect to since it is dynamic?

In my particular case, I'll be using local ipc, though I suppose the question can pertain to remote ipc as well.

https://grpc.github.io/grpc/csharp/api/Grpc.Core.ServerPort.html

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橘香 2025-02-18 00:37:44

他们必须被告知。

pickunused 是保存服务器(开发人员)确定可用端口的便利。它不会更改或简化客户端的端口确定。

客户需要了解远程主机地址(如果有)和套接字/端口,才能连接到服务器。

可以查找主机地址(例如DNS),并且插座发现的唯一解决方案是:

  1. 静态(不是 pickunused
  2. 众所周知的80上的http和443
  3. 服务上的http/s port Lookup(服务器将其端口发布到某些服务发现 1
  4. 端口扫描

1 - 也许是使用 pickunused

They must be told.

PickUnused is a convenience to save the server (developer) determining an available port. It does not change nor simplify the client's port determination.

Clients need to know a remote host address (if any) and a socket/port in order to connect to a server.

Host addresses can be looked up (e.g. DNS) and the only solutions for the socket's discovery are:

  1. Static (not PickUnused)
  2. Well-known e.g. HTTP on 80 and HTTP/S on 443
  3. Service|Port lookup (server publishes its port to some service discovery1)
  4. Port scanning

1 -- Perhaps another gRPC service using PickUnused ???? Turtles, all the way down!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文