NetCore.SignalR.Demo演示

匿名 (未验证) 提交于 2019-12-02 22:06:11

项目github,点击https://github.com/wangpengzong/NetCore.SignalR.Demo

1.打开服务端Server(\SignalR.Server\bin\Debug\netcoreapp2.2\win10-x64\SignalR.Server.exe)

2.打开客户端,开5个标签页,分别是

涓や釜

Javascript调用:

test/index种user,输入00000000-0000-0000-0000-000000000000message输入hi,点击sendmessage,就可以在全部的标签页看到以上页面,此时调用的是

document.getElementById("sendButton").addEventListener("click", event => {

.net 客户端调用

再打开一个标签页,输入http://localhost:63891/test/SendMessageToAll

这个和上面的say hi都是调用SendMessageToAll方法,发送给所有人

将此标签页输入http://localhost:63891/test/SendMessageToUser,调用SendMessageToUser方法,此时前两个页面显示00000000-0000-0000-0000-000000000000 says SendMessageTo11

将此标签页输入http://localhost:63891/test/SendMessageToGroup1,调用SendMessageToMyGroup方法,此时前三个页面显示00000000-0000-0000-0000-000000000000 says SendMessageToGroup11

将此标签页输入http://localhost:63891/test/SendMessageToGroup1and2,调用SendMessageToMyGroup方法,此时前四个页面显示00000000-0000-0000-0000-000000000000 says SendMessageToGroup11和组2

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