Пример #1
0
        public async Task sendAll(SendMsg sendMsg)
        {
            await Reply.SendAsync("reply", "回复");

            // logger.LogInformation($"{ConnectionId}:发送所有人消息");
            await Client.All.SendAsync("sendAll", sendMsg.msg);
        }
Пример #2
0
        public async Task send(SendMsg sendMsg)
        {
            await Reply.SendAsync("send", "回复");

            //logger.LogInformation($"{ConnectionId}:发送群组消息");
            await Client.Group.SendAsync(sendMsg.roomId, "send", sendMsg.msg);
        }
Пример #3
0
        public async Task send(SendMsg sendMsg)
        {
            await Group.AddAsync("11", "2");

            await Reply.SendAsync("test", new { msg = "asdasd", ss = "123123" });

            await Task.Delay(2);
        }
Пример #4
0
 public async Task current(SendMsg sendMsg)
 {
     logger.LogInformation($"{ConnectionId}:发送给指定的用户");
     await Client.Current.SendAsync(sendMsg.connectionId, "current", sendMsg.msg);
 }
Пример #5
0
 public async Task other(SendMsg sendMsg)
 {
     logger.LogInformation($"{ConnectionId}:发送指定连接的之外的其它用户消息");
     await Client.Other.SendAsync(sendMsg.connectionId, "other", sendMsg.msg);
 }
Пример #6
0
 public async Task leave(SendMsg sendMsg)
 {
     await Group.RemoveAsync(sendMsg.roomId, ConnectionId);
 }
Пример #7
0
 public async Task join(SendMsg sendMsg)
 {
     await Group.AddAsync(sendMsg.roomId, ConnectionId);
 }