主机:有一个函数是:IsOneWay=False
此函数调用-弹出主机MessageBox中的。
Client:有一个winform,其中只有按钮,它调用主机的func。
如果主机IsOneWay=true中的函数-我可以多按下客户端按钮(他不在乎,如果我在主机上发布了消息框)。
但如果IsOneWay=False -那么他只让我按了一次(,直到,我在主机上发布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 ?发布于 2011-09-21 19:47:56
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...https://stackoverflow.com/questions/7505575
复制相似问题