开发者

WCF NamedPipe: PerSession-Single or Singleton-Multiple

开发者 https://www.devze.com 2023-02-14 06:40 出处:网络
I\'m building web application (in this context the client) which talk with a different process (in this context the server) through a namedpipe wcf service (WCF 4).

I'm building web application (in this context the client) which talk with a different process (in this context the server) through a namedpipe wcf service (WCF 4).

After reading many articles I was thinking to create a pool of proxy connected to the server (I've read it provide better performance) used in roundrobin.

Each call will be very short, on the server i need to reads and writes simple properties on f开发者_运维问答ew objects but this objects are shared so i must use locks in any case. I expect very high concurrency.

Beacuse of the pool, the client will have N session always open with server.

I was wondering what should be the best settings for InstanceContext-ConcurrencyMode between PerSession-Single or SingleInstance-Multiple.

Thank You


My opinion: Do not use custom pool of proxies. Use build-in pooling of connections. You can't fully control connectionPooling in predefined bindings but you have full control in customBinding when using namedPipeTransport.

From implementation perspective in your client - use new proxy for each client's request. Don't share proxies among requests.

0

精彩评论

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