Broadcast to Clients except the Caller #105

tomsdev opened this Issue Dec 27, 2011 · 14 comments


None yet

7 participants


Maybe it's already possible but i can't find how to do it.

Could you add to the Hub a easy way to broadcast to every Clients but not the Caller (similar to Clients[Context.ClientId])?

Actually the Caller is in the Clients so he always receive his messages (sometimes it's not necessary).


This would be a great feature so that the client code of the sender doesn't have implement logic to track and ignore any responses that were a result of its own send action.

SignalR member


For hubs:

ClientsExcept(params string[] excludedConnections).someMethod()

For persistent Connection.

Connection.Broadcast(string message, params string[] excludedConnections)

Discussion notes:

  • Change the IMessageBus interface to pass a list of connection ids to exclude which is persisted with the message (so it works on farms etc). Then we read that and do nothing if we're in that list.
@davidfowl davidfowl was assigned Mar 8, 2012

I think it should do the stuff thanks :)


Works for me

SignalR member

Just realized that in, broadcast means sending to all clients except the sender. This could be a useful default, although it'll be a breaking change. We'll think about that a little bit.


Working with SignalR 0.5 in Hubs, does ClientsExcept still exist? I can access Clients directly from the Hub but not ClientsExcept.

SignalR member

0.5.4? ;)


i've been working on this on a branch for a few weeks. I'm not ready to do a pull request (unless you'd prefer to discuss over that), because its got a bunch of my test code in it that I want to get rid of beforehand.


Looking for feedback in a few areas:

  1. Implementation details and whether this is a good solution for the problem.
  2. Does this even make sense to open a pull for the 0.5.x series since the Queue got rewritten for 1.0?
  3. Does the message queue in 1.0 offer this ability built in?
  4. I implemented this on the IClientProxy interface that became usable in 0.5.3, I didn't implement it for dynamic invocation methods because my implementation was clunky.

i see this was moved to 1.0alpha...

@davidfowl davidfowl was assigned Sep 8, 2012

is this feature available now?

SignalR member

It will be in the next version.

SignalR member

This is finally implemented in master (1.0 alpha1).

Clients.All - All connected clients
Clients.Others - Everyone but me
Clients.Group("groupName", exclude) - All clients in that group (excluding the exclude list of connection ids)
Clients.Client("connectionid") - A specific client
Clients.OtherInGroup("groupName") - All clients in that group except the caller
Clients.AllExcept(exclude) - All clients except the ones specified in the exclude list.


SignalR member


@Xiaohongt Xiaohongt closed this Oct 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment