繁体   English   中英

IsOneWay = false时,wcf如何阻止客户端?

[英]How the wcf blocks the client when IsOneWay=false?

主机 :具有以下功能: IsOneWay=False

调用此函数时- 在主机中弹出MessageBox

客户端 :有一个winform, 只有一个按钮可以调用主机的功能。

如果在主机IsOneWay = 真正的功能-我可以多按客户按钮(他不关心 ,如果我发布了消息框上的主机或没有)。

如果IsOneWay = -然后他让我按只有一次直到我松开主机的MesageBox)..

host does he do that ?

How the Client knows that he should be blocked until the user releases the MessageBox on the Host side ?

在关闭消息框之前,WCF主机不会响应客户端。

如果要闯入客户端的调试器,则应该看到代码仍在对主机的WCF调用中。 如果您等待了足够长的时间,它将最终超时。 WCF可以执行此操作,因为IsOneWay=false要求服务器先返回,然后客户端才能继续执行。 IsOneWay=true ,客户端发送请求,服务器立即成功响应,允许客户端继续执行(在执行任何服务器代码之前)。

IsOneWay=false
   Client       Server
   ------    |  ------
1. click    --> method --> messagebox waits for OK
(client can't continue until server returns)
2. continue <-- method <-- user dismisses messagebox

IsOneWay=true
   Client     Server
   ------  |  ------
1. click  -->  method --> messagebox waits for OK
(client continues regardless of server state)
2. click  -->  method --> 2nd messagebox waits for OK
                          user dismisses messageboxes
etc...

暂无
暂无

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

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