简体   繁体   English

在Azure Service Fabric应用程序中的动态端口范围上打开多个套接字

[英]Open multiple sockets on dynamic port range in Azure Service Fabric Application

We have an application that we put in Azure Service Fabric. 我们有一个应用程序放置在Azure Service Fabric中。 This application need to open multiple sockets on multiple port. 该应用程序需要在多个端口上打开多个套接字。
This application need to use some static port too. 该应用程序也需要使用一些静态端口。 Is it possible in Service Fabric to work with dynamics ports for socket or did we need to put all port in ServiceManifest.xml ? Service Fabric是否可以使用套接字的动态端口,还是需要将所有端口都放入ServiceManifest.xml

If I understand your question correctly, it's true for both. 如果我正确理解了您的问题,那么两者都是正确的。 Generally you need to specify all the endpoints in ServiceManifest that service should listen on, and then add a listener per each endpoint. 通常,您需要在ServiceManifest中指定该服务应侦听的所有端点,然后为每个端点添加一个侦听器。 As for dynamic ports, when you specify the endpoint you could leave the port empty so SF will pick some random one for you at run-time. 对于动态端口,当您指定端点时,可以将端口留空,以便SF在运行时为您随机选择一些端口。

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

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