codeape
codeape

Reputation: 100766

WCF net.tcp binding: Is port sharing required to host multiple services?

We have run into some problems hosting WCF on IIS (the SMSvcHost.exe Event Log ID 8 problem).

The IIS setup is as follows:

In the web.config files, all the net.tcp bindings have portSharingEnabled="true".

Questions:

Now I could of course just try it out, but I currently only have a production server to test it on and want to do some research first.

Upvotes: 0

Views: 2363

Answers (1)

PavlinII
PavlinII

Reputation: 1083

Answers to your questions:

  • Yes, it will stop working as you expect it to. Your reasoning is correct.
  • You can have multiple applications under one site (therefore in same pool) with portSharingEnabled="false". You can share that port, you'll just have different addresses as you already do. And it will work just fine:
    • net.tcp://example.com:808/FirstApp/Service.svc
    • net.tcp://example.com:808/SecondApp/Service.svc
    • net.tcp://example.com:808/ThirdApp/Service.svc
  • Port sharing is not required. But you can't share port numbers in this case.

You can try to migrace one of your applications to see how it works. Add one binding to IIS site, add second endpoint with new port to web.config and update client to see how it works. This update will require to reconfigure all client applications as well since their server will be on different port.

Upvotes: 1

Related Questions