using WCF Callback and asp.net to implement publish/subscribe pattern

不羁的心 提交于 2019-12-04 19:56:15

I don't know why you don't get list of clients - you should but there are much worse problems with your code.

You can't use WCF callback in ASP.NET application. It cannot work because page lives only to serve single HTTP request - it means it most probably lives only for fraction of second and so also your registration. Even If you will be able to get list of clients you will not be able to call OnRegister or OnMessageSending because there will be no proxy listening for these calls.

Even if you force proxy to live after request processing it will still notify only code behind, not your pages rendered in client browser.

Another problem is that it can work only with net.pipe or net.tcp binding. It will not work with wsDualHttp. It is very problematic to open multiple duplex clients from the same machine when using wsDualHttp.

You are doing it completely wrong. What you need is AJAX polling from client browser to asp.net which will call simple service in your chat system.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!