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.
- Open command prompt as administrator
- Run the command: c:\Windows\System32> net start NetTcpPortSharing
The second option is:
- Click on Start Button
- Select Run option
- Type Services.msc in Run window
- 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.
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.
In this way we can enable port sharing.