WCF ConcurrencyMode = ConcurrencyMode.Multiple不起作用

编程入门 行业动态 更新时间:2024-10-27 06:34:08
本文介绍了WCF ConcurrencyMode = ConcurrencyMode.Multiple不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我创建了以下服务:

I''ve created the following service:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)] public class ActivatorService : IActivatorService private bool function() { Thread.Sleep(60000); return false; }

我尝试从2-3个客户端调用它,但是直到另一个客户端退出该函数,任何客户端都无法调用该函数. 服务为何不同时调用该方法?

I try to call it from 2 - 3 clients, but no client can call the function until another client exited from it. Why is the service not calling the method concurrently?

推荐答案

请看Kenny W的这篇文章 InstanceContextMode,ConcurrencyMode和服务器端线程 [ ^ ].希望对您有所帮助. Take a look at this article from Kenny W InstanceContextMode, ConcurrencyMode, and Server-side Threading[^]. Hope it helps.

通过在其他线程中创建ServiceHost来解决. 在WinForm应用程序中创建主机不允许其使用多线程. Solved by creating the ServiceHost in a different thread. Creating the host in a WinForm application did not allow it to use multithreading.

InstanceContextMode.唯一的问题是将其更改为percall或persession InstanceContextMode.Single is the problem change it to percall or persession

更多推荐

WCF ConcurrencyMode = ConcurrencyMode.Multiple不起作用

本文发布于:2023-11-09 03:10:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571232.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不起作用   WCF   ConcurrencyMode   Multiple

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!