简体   繁体   English

多任务WCF通道使用情况(ems)异常

[英]Exception in multi-Task WCF channel usage (ems)

I receive an exception of type 我收到类型异常

Exception receiving EMS message: The service did not respond. 接收EMS消息异常:服务未响应。 When calling the code below from more than one task. 从多个任务中调用以下代码时。

Task.Factory.StartNew(() =>
{ 
        var service = CreateChannel();                                           
        try
        {
              return service.GetStuff(string blah);
        }
        finally
        {
               var channel = ((IClientChannel)service);
               try
               {
                    channel.Close();
               }
               catch
               {
                    channel.Abort();
               }
         }
 });
private IService CreateChannel()
{
    lock (_channelFactory)
    {
        return _channelFactory.CreateChannel();
    }            
}

If i remove the Channel.Close() there is no exception. 如果我删除Channel.Close()也不例外。

Any ideas? 有任何想法吗?

Self Answer 自我回答

Updating my tibco.ems.wcf assembly fixed this. 更新我的tibco.ems.wcf程序集解决了此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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