开发者

Multiple WCF Services (self hosted)

开发者 https://www.devze.com 2023-01-26 03:36 出处:网络
I have a set of WCF Services which are hosted from within a Windows Service. I need to run multiple instances - which is fine, I can do that using unique endpoints, however for a given instance I ne

I have a set of WCF Services which are hosted from within a Windows Service.

I need to run multiple instances - which is fine, I can do that using unique endpoints, however for a given instance I need to known which instance it is.

For example I might have end points:

net.tcp://localhost:9000/Customer1/MyServerFunctions

net.tcp://localhost:900开发者_StackOverflow1/Customer2/MyServerFunctions

When a the WCF Service is called I need to know whether it is for Customer1 or Customer2

Suggestions?


Your service implementation can call

OperationContext.Current.Channel.LocalAddress

to determine which customer endpoint the request came from.

0

精彩评论

暂无评论...
验证码 换一张
取 消