Click here to Skip to main content
12,512,130 members (54,743 online)
Click here to Skip to main content
Add your own
alternative version

Stats

60.9K views
36 bookmarked
Posted

Port Sharing Features in WCF

, 7 Aug 2007
Rate this:
Please Sign up or sign in to vote.
Port Sharing Features in WCF

Introduction

WCF (formerly Indigo), is the next generation way of developing distributed applications in .NET. Apart from being developed from Service Orientation perspective in mind and unifying all the distributed technologies of the Microsoft stack, it encompasses a variety of other features which either might not be highlighted or might be not been well documented. One among those features is the port sharing feature on TCP protocols. Organizations have NAT and firewalls for obvious security reasons. If any application that needs to be deployed and accessed across the firewall, one needs to rely on the common TCP ports that firewalls open. HTTP protocol normally uses Port 80. Thanks to the usage of HTTP.sys and IIS 6.0, wherein Port 80 can be used and shared across multiple applications, the problem is that there is not a single way in which we can enable port sharing via TCP.

What if the same port can be shared across multiple applications that run on TCP?

The answer to the same lies in the NET.TCP Port Sharing feature of WCF. In this article, we will see how easily we can achieve the same in WCF.

What happens if same port is been used by applications running on TCP ?

Screenshot - pic1.jpg

In the above application, App 1 is running on TCP Port 2555 and client 1 is interacting with it. Now if Client 2 wants to access App 2 on the same port 2555, it will encounter the following error:

"There is already a listener on IP endpoint <Endpoint ID>. Make sure that you are not trying to use this endpoint multiple times in your application and that there are no other applications listening on this endpoint. "

NET.TCP Port sharing

Now through NET.TCP Port sharing service, multiple applications in WCF can share the same ports.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Nishith Pathak
Web Developer
India India
Nishith Pathak is an avid reader,Prolific writer, Speaker for Microsoft India,Published Author of APress and a Microsoft Purist.He is MVP, MCPD, MCTS MCSD.Net,MCAD.Net(EA),MCSD. His proficiency lies in exploring Microsoft technology and to share them with other peers. He is a contributing author and an avid technical reviewer for multiple electronic and print publications. He has recently co-authored a book on WCF called Pro WCF: Microsoft Practical SOA Implementation for APress Inc, USA. Over the years, he has also been involved in providing consultancy and training services to corporations. He has been awarded with Microsoft Most Valuable Professional (MVP).Working since beta version of .Net makes his competecy in .Net. He can be contacted at NisPathak@Hotmail.com or at his blog http://DotNetPathak.Blogspot.com. Currently he is focused on key areas of the Microsoft platform, specifically Distributed Computing, service orientation and exploring VISTA and help companies architecting solutions based on Service Oriented Architecture.

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralMy vote of 1 Pin
Member 1061291222-Dec-14 11:36
memberMember 1061291222-Dec-14 11:36 
GeneralMy vote of 1 Pin
jlogopak3-Jan-13 22:28
memberjlogopak3-Jan-13 22:28 
So how do you actually do it then? You know, CODE!
GeneralMy vote of 1 Pin
raizor216-Jan-12 23:18
memberraizor216-Jan-12 23:18 
GeneralMy vote of 1 Pin
Michael Freidgeim22-Jul-11 14:31
memberMichael Freidgeim22-Jul-11 14:31 
GeneralMy vote of 1 Pin
Cristian_2k14-May-11 7:44
memberCristian_2k14-May-11 7:44 
GeneralMy vote of 1 Pin
Michel Renaud2-Jun-10 5:18
memberMichel Renaud2-Jun-10 5:18 
GeneralMy vote of 1 Pin
ricardpreto26-May-10 22:58
memberricardpreto26-May-10 22:58 
GeneralMy vote of 1 Pin
Tiago15614-Oct-09 10:07
memberTiago15614-Oct-09 10:07 
GeneralMy vote of 1 Pin
captainplanet012315-Jun-09 6:24
membercaptainplanet012315-Jun-09 6:24 
GeneralMy vote of 1 Pin
dmitchell10-Mar-09 7:27
memberdmitchell10-Mar-09 7:27 
GeneralMy vote of 1 Pin
__Gianluca__1-Dec-08 6:11
member__Gianluca__1-Dec-08 6:11 
GeneralRe: My vote of 1 Pin
MarkJoel6021-Feb-09 16:10
memberMarkJoel6021-Feb-09 16:10 
GeneralNice Article Pin
RazanPaul19-May-08 4:40
memberRazanPaul19-May-08 4:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160929.1 | Last Updated 8 Aug 2007
Article Copyright 2007 by Nishith Pathak
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid