简体   繁体   English

如何让wcf服务每次只接受1个客户端

[英]how to let wcf service to accept only 1 client each time

I have a question about WCF service which give the client the ability to mess up with Computer files (copy/paste/delete...etc). 我有一个关于WCF服务的问题,它让客户端能够搞乱计算机文件(复制/粘贴/删除等等)。
service should accept only 1 client at a time, it shouldn't accept a client while another client is already connected, so what configuration does this job? 服务一次只能接受一个客户端,它不应该接受客户端而另一个客户端已经连接,那么这个工作有什么配置呢? I'm using NetTcpBinding. 我正在使用NetTcpBinding。

You need not to do anything as default service behavior is to execute one call at a time. 您无需执行任何操作,因为默认服务行为是一次执行一个调用。 Which means if A is invoking X method and B also want to invoke X method then B request wont be entertain till A request is finished. 这意味着如果A正在调用X方法而B也想调用X方法,那么B请求将不会被娱乐直到请求完成。

But if your are thinking that even after method execution nobody should access the methods then you have to handle this at your own by using Sessions!! 但是如果你认为即使在方法执行后没有人应该访问这些方法,那么你必须使用Sessions自己处理这个!

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

相关问题 如何让WCF服务在不从服务调用其方法的情况下向客户端发送消息? - how to let WCF service to send messages to the client without calling its method from the service? 如何使WCF服务服务器 - 客户端时差独立? - How to make WCF service server-client time difference independent? 如何将wcf服务限制为仅一个客户端应用程序 - how to restrict a wcf service to one client application only 如何创建WCF服务,以接受来自基于Web的客户端的不同格式的大文件 - How can I create a WCF service that can accept large files of differing formats from a web based client 如何使WCF服务一次仅接听一个电话 - How to make WCF Service take only one call at a time 当我只有 WCF 客户端时如何创建新的 WCF 服务 - How to make a new WCF service when I only have a WCF client 如何将WCF服务参考客户端与X.509客户端证书(仅作为.pfx文件一起使用)一起使用? - How to use WCF service reference client with X.509 client certificate, which is only available as .pfx file? 仅为WCF服务上可用的服务合同接口之一生成客户端 - Generate client for only one of the Service Contract interfaces available on a WCF service 如何让用户决定在WCF中请求哪个服务? - How to let user decide which service to request in WCF? 如何通过客户端显示WCF服务的结果 - How to display result of a WCF service through a client
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM