SIGN UP MEMBER LOGIN:    
ARTICLE

Sharing port between services in netTcpBinding

Posted by Dhananjay Kumar Articles | WCF with C# March 09, 2011
WCF allows us to share a port between services in a TCP connection. A HTTP connection is allowed on IIS using HTTP.SYS Service.
Reader Level:

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.

Login to add your contents and source code to this article
share this article :
post comment
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Team Foundation Server Hosting
Become a Sponsor