views:

32

answers:

1

Hello,

I create one global ChannelFactory connection to my WebService (in global.asax) and I access this CannelFactory from every web-request. My WCF-Service uses:

InstanceContextMode = InstanceContextMode.Single
ConcurrencyMode = ConcurrencyMode.Multiple
.Net 4.0
netTcpBinding
no security, no metadata exchange

Now my questions:

1) Is it better to create an own ChanelFactory for every incoming request that accesses the WebService and to increase the connection limit in my WCF-Service, too?

2) When there are some concurrent requests to my WebService (the server has much simultanious requests), will they be queued or will the global ChannelFactory process/send every request simultaneously?
If so, will the ChannelFactory take care for the thread safety on the client side?

Thank you very much for your help!

A: 

I have been using cached channel factories for quite some time in a sizable project and have not had any issues so far. If the naming follows the standard understanding of factories and their results it should be a fair use to keep the factory along and dispose of its results (in this case the channel).

flq