How to configure SF TCP/IP Listener to listen on multiple ports

Tavi Truman 26 Reputation points
2020-10-26T21:50:00.67+00:00

We have a native TCP/IP C/S technology we want to port to Azure SF Cluster; the server application listens on 3 ports once the client is connected and registered. We have written TCP/IP listener and we can specify a singular port and we are able to make the first primary connection over the specified port recorded in the SF manifest; however, once the client connects two other connections are made to the service over ports specified by the server at runtime. The first connection to the server will return data to the client and contains information for the client to make other connections on ports allocated by the server. Is there a way to configure SF Listener to observe more than one port?

Azure Service Fabric
Azure Service Fabric
An Azure service that is used to develop microservices and orchestrate containers on Windows and Linux.
264 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Tavi Truman 26 Reputation points
    2020-11-03T20:22:54.987+00:00

    @vipullag-MSFT thanks for getting back to me. No firewall issues and I tried to add additional listeners like this:

      <Endpoints>  
          <Endpoint Name="ServiceEndpointV2" />  
          <!-- This endpoint is used by the communication listener to obtain the port on which to   
           listen. Please note that if your service is partitioned, this port is shared with   
           replicas of different partitions that are placed in your code. -->  
          <Endpoint Name="TrinityProtocolEndpoint" Protocol="tcp" Port="8808"/>  
          <Endpoint Name="TrinityProtocolEndpointB" Protocol="tcp" Port="8809"/>  
          <Endpoint Name="TrinityProtocolEndpointC" Protocol="tcp" Port="8810"/>  
          <Endpoint Name="TrinityProtocolEndpointD" Protocol="tcp" Port="8811"/>  
    
          <Endpoint Name="TrinityHttpEndpoint" Protocol="tcp" />  
    
          <!-- This endpoint is used by the replicator for replicating the state of your service.  
           This endpoint is configured through a ReplicatorSettings config section in the Settings.xml  
           file under the ConfigPackage. -->  
          <Endpoint Name="ReplicatorEndpoint" />  
          <!-- This endpoint is used by the trinity-over-remoting proxy, running on fabric service remoting.  
           Remove this, and the reference to Trinity.ServiceFabric.Remoting, if you do not want to enable  
           this feature. -->  
          <Endpoint Name="TrinityServiceFabricRemotingEndpoint" />  
      </Endpoints>  
    

    This does not work without me making changes to our customer Naming Service so I will need to make those changes; it would also seem that I'll need to do some more port management so as to care for the collision of port assignments.

    Still testing!

    1 person found this answer helpful.
    0 comments No comments

  2. Tavi Truman 26 Reputation points
    2020-12-09T19:43:29.297+00:00

    So, if one is thinking that it is possible to port an TCP/IP (RPC-like) C/S application to SF without changes, due to the nature of Port assignment usage, even the simplest of design and programming will, most likely, require significant changes and enhancements. Microsoft provides very little guidance when it comes to porting legacy TCP/IP program design as well as modern TCP/IP design schemes. We are working through the issues we have run into, and it takes a moment to consider that most enterprises with WCF or TCP based programming will not be able to port to SF without substantial adaptations.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.