: @aspnet/signalr:1.1.0 这是我的示例Hub: public class MyHub: Hub<IMyHub> public override async Task OnConnectedAsync// This newMessage call is what is not being received on the front end
在我的StartUp类中,ConfigureServices的内部有以下几行 services.AddSignalR(); .build(); 最后,我的hub中有以下类: public class UserErrorHub : Hub public async override Task OnConnectedAsync} {
name = "anonymous&quo
如何以及在何处保存connectionId和相应的WorkerID,以便每当MiniAppController收到请求时,它将使用hubContext通过正确的连接触发请求。string message) HubCallerContext context = this.Context; }
public override as
现在的问题是,即使在获取了userIdList和name参数的值之后,也不会触发hubConnection.On<string>("ReceiveAssignmentCreatedNotification但当存在名称时,将调用NotifyStudentAboutAssignmentCreated(字符串名)方法,但它不会在await Clients.User(userId).SendAsync("ReceiveAssignmentCreatedNotification) foreach (var u
我将io.on('connection', function (socket) {封装在post请求中。然后在post请求中调用socket.emit('news', 'username taken');。由于某些原因,当我调用此函数时,它不会向客户端发送任何内容。当我将emit更改为io.emit('connection', function (socket))时,它会起作用,并将数据发送到客户端。我对该解决方案的问题是,使用io.emit会将数据发送到所有连接的套接字。我的问题是如何在这个post请求中使用socket.emi