Broadcasting message to all clients except self in SignalR

后端 未结 2 821
不思量自难忘°
不思量自难忘° 2021-02-02 10:18

I realize that these questions are similar:

SignalR - Broadcast to all clients except Caller

Send a message to all clients in a Group, except for the current cl

2条回答
  •  一生所求
    2021-02-02 10:35

    If you're sending the message in a method on the Hub class, you can also use Clients.Others to exclude the calling client. You only need to use AllExcept(id) if you're not in a hub method.

    See the following for details:

    http://www.asp.net/signalr/overview/hubs-api/hubs-api-guide-server#selectingclients

提交回复
热议问题