Sharing port between services in netTcpBinding

WCF allows us to share a port between Services in a TCP connection. A HTTP connection is allowed in IIS using HTTP.SYS Service. 

By default, port sharing for TCP connections are disabled.  So to use port sharing between services using netTcpBinding, we need to first enable this Windows service on the server. 

To enable a service we have two options. 

The first option is through command prompt. 
  1. Open command prompt as administrator 

  2. Run the command:   c:\Windows\System32> net start NetTcpPortSharing

    portsharingtcpservice1.gif
The second option is:
  1. Click on Start Button

  2. Select Run option 

  3. Type Services.msc in Run window 

    portsharingtcpservice2.gif

  4. In the list of services select and right click Net.Tcp Port Sharing Service. Choose properties. If Startup type is disabled then change it to Automatic. After changing Start up type click on Start button to Start the service. 

    portsharingtcpservice3.gif
So now Net.Tcp Port sharing service is running.  The next step we need to do is to configure WCF service to share the port. 

portsharingtcpservice4.gif 

In this way we can enable port sharing.

Up Next
    Ebook Download
    View all
    Learn
    View all