WCF - Close duplex ServiceHost blocks for CloseTimeout duration if closed when client (s) connect

I have a Windows service that hosts three different WCF duplex channels. Customers can connect to updates sent to them through their callback contract. Essentially, there are three pub-sub channels.

This service takes a long time to bounce when connecting clients. The call ServiceHost.Closetakes 10 seconds to return (it takes 30 seconds to stop the service). It turns out mine closeTimeoutin the configuration is 10 seconds. Changing this value indicates that this is causing the problem.

What do I need to do to quickly close the channel? I do not like the idea that something is leaving. I could name it Abort, but it seems like there should be a better way. I have not seen this on duplex channels before, so suppose this is due to the fact that it is duplex.

Ideally, the client will be immediately notified of a channel failure so that the user immediately notices that the updates are paused.

+5
source share
2 answers

"Ideally, a client will be immediately notified of a channel failure so that the user immediately notices that updates are paused."

The WCF client instance has events you can subscribe to:

  • Closed
  • Closing
  • Faulted
  • Open
  • Opening.

Faulted , - .

, 30 . ?

+1

, - ( , ) .

0

All Articles