コード例 #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);
 }