简体   繁体   中英

WCF with wsDualHttpBinding blocking calls

my case is that I'm using wsDualHttpBinding as a binding.

But I've noticed something kind of unexpected. When I try to send a request to a service operation, but my code is handling a callback message (I've put a Thread.Sleep there to simulate), then the service call gets stuck (and can even get timeouted) until the callback message is handled fully. Shouldn't they be independent, or the channel can only handle one message at the time, doesn't matter if it's a service request or a callback message? I'm using the same channel all to time, either to receive the callbacks messages or to send out new requests. This application runs as a service, so there's no UI involved.

Try

[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Reentrant)]

It is special mode to support callbacks in single-thread configuration.

http://msdn.microsoft.com/en-us/library/system.servicemodel.concurrencymode.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM