简体   繁体   中英

Exception in multi-Task WCF channel usage (ems)

I receive an exception of type

Exception receiving EMS message: The service did not respond. 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.

Any ideas?

Self Answer

Updating my tibco.ems.wcf assembly fixed this.

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