none
Do I need to enable Application Role to enable port sharing? RRS feed

  • Question

  • I want to run multiple WCF services (on the same machine) using the NET.TCP protocol and want to use port sharing -- each service will use a distinct subdomain.  I know how to configure the bindings for that, no issues there.  I also know to start up the NET.TCP Port Sharing service – I’ve done that.   I’ve enabled the Web Server role via Server Manager.  
    Some MSDN articles seem to indicate that I should also enable the Application Server role in order to enable port sharing.   I'm pretty sure that's not necessary.  The simple fact that I’m able to start up the NET.TCP Port Sharing Service (under “Services”), would suggest otherwise.  But I would like to confirm this.  By the way, my target platform is Windows Server 2008 R2 running IIS 7.5.  My WCF services target version 4.5 of the .NET Framework.

    A second question I have is:   is there any performance penalty caused by the use of port sharing compared with using distinct port numbers for each WCF service?

    Mike

    Tuesday, June 25, 2013 4:13 PM

Answers

  • Query : Application Server role needs to be installed for using Net tcp port sharing for WCF services.

    Answer:
    1. When Web Server role is installed we can use Net tcp port sharing but there we need to manually start up the Net.Tcp Port Sharing Service, in order to use it since it is turned off by default.

    2. However when Application Server role is being installed it asks for the Net.Tcp Port Service Sharing installation if we check the checkbox ,the service will get started and its startup type will be Automatic.

    http://technet.microsoft.com/en-us/library/cc772001.aspx

    Hope this helps !

    • Marked as answer by mkedwards Wednesday, July 31, 2013 6:34 PM
    Wednesday, July 31, 2013 5:56 PM

All replies

  • Hi,

    To using port sharing feature, as you mentioned, first of all, it is needed to manually enable Net.TCP Port Sharing Service using MMC, the easiest way to use  net.tcp:// port sharing in your WCF application is to expose a service using the NetTcpBinding and set PortSharingEnabled property of the binding to true. Check documents. 

    #How to: Enable the Net.TCP Port Sharing Service

    http://msdn.microsoft.com/en-us/library/ms733925.aspx

    #How to: Configure a Windows Communication Foundation Service to Use Port Sharing

    http://msdn.microsoft.com/en-us/library/ms731810.aspx

    If you want to change the default configuration for the Net.TCP Port Sharing Service, you can refer this document to configure: http://msdn.microsoft.com/en-us/library/aa702669.aspx

    >>Do I need to enable Application Role to enable port sharing?

    Application Server role you mentioned seems necessary for Windows Server( Windows Server 2008, Windows Server 2008 R2, Windows Server 2012), see at: Checklist: Use TCP Port Sharing to Allow Multiple WCF Applications to Use the Same TCP Port.

    >>A second question I have is:   is there any performance penalty caused by the use of port sharing compared with using distinct port numbers for each WCF service?

    I do not test this on my side, but it seems port sharing will have little impact on the performance from a discussion here: http://stackoverflow.com/questions/3928169/performance-on-wcf-services-on-the-same-port

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 26, 2013 7:22 AM
    Moderator
  • Haixia,

    I appreciate your taking the time to look up the various MSDN reference pages and respond to my questions.  As I mentioned in my original post, I already know how to configure the NET.TCP binding on a WCF service and have done so (successfully) for two WCF services running on the same server.  I also have already successfully started up the port-sharing service using the Microsoft Management Console (MMC).   The two services are configured to use the same port number.  I did some very limited testing of the two WCF services, and they are working.  Furthermore, this was all done with only the Web Server role installed -- I did not install the application server role.

    I continue to strongly suspect that the application server role does *not* have to be installed for port-sharing to work.  The TechNet article you referenced ("Checklist:  Use TCP Port Sharing to Allow Multiple WCF Applications ...") is assuming, I think, that the objective is to set up an application server rather than a web server.

    Can you please consult with Microsoft development staff and get a definitive answer to this question?  I would greatly appreciate it.  It is hard to believe that the MMC would allow me to start up the port sharing service if it were not enabled, and the limited testing I did suggests that it's working.

    BTW, thanks for locating the StackOverflow article which discussed the question about potential impacts of port-sharing.

    Mike

    Wednesday, July 3, 2013 3:55 PM
  • Hi,

    Thanks for your feedback.

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, July 4, 2013 11:14 AM
    Moderator
  • Query : Application Server role needs to be installed for using Net tcp port sharing for WCF services.

    Answer:
    1. When Web Server role is installed we can use Net tcp port sharing but there we need to manually start up the Net.Tcp Port Sharing Service, in order to use it since it is turned off by default.

    2. However when Application Server role is being installed it asks for the Net.Tcp Port Service Sharing installation if we check the checkbox ,the service will get started and its startup type will be Automatic.

    http://technet.microsoft.com/en-us/library/cc772001.aspx

    Hope this helps !

    • Marked as answer by mkedwards Wednesday, July 31, 2013 6:34 PM
    Wednesday, July 31, 2013 5:56 PM
  • Yes, your answer matches my experience.   

    Thanks for the response.

    Mike


    • Edited by mkedwards Wednesday, July 31, 2013 11:29 PM corrected typos
    Wednesday, July 31, 2013 6:36 PM