.Net 远程处理中的两种方式通信
一旦客户端和服务器之间的通信建立,客户端就可以通过代理调用远程对象函数。在这种情况下,Server端是否可以调用Client端的函数?如果是的话,以什么方式?
谢谢,
Once the communication between Client and Server is created, the Client could call the remote object functions through proxy. Under this situation, is it possible that Server could call functions reside in Client side? If so, in what way?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过事件实现了这一点。这并不完全是您所要求的,但客户端可以访问服务器上的远程对象,它还可以添加事件处理程序。这样,当服务器想要通知客户端某件事或向其发送消息时,它可以引发事件。
如果您搜索.Net Remoting Events,您将得到一个很多。我已经很多年没有构建使用远程处理的系统了,所以我记不清所有的细节了。
这是经典的聊天室示例: http://www.codeproject.com/KB/ IP/remotingandevents.aspx
I have accomplished this through events. Its not exactly what you are asking, but the client can access the remote object on the server, it can also add event handlers. This way when the server wants to notify the client of something or send it a message, it can raise an event.
If you search .Net Remoting Events you will come up with a lot. Its been a lot of years since I have built a system that uses remoting so I can't recall all of the details.
Here is the classic chat room example: http://www.codeproject.com/KB/IP/remotingandevents.aspx