Skip to content

Instantly share code, notes, and snippets.

@briandela
Forked from davidfowl/today.cs
Created September 16, 2012 07:39
Show Gist options
  • Save briandela/3731464 to your computer and use it in GitHub Desktop.
Save briandela/3731464 to your computer and use it in GitHub Desktop.
VNext SignalR API
Clients.addMessage(message);
Others.addMessage(message); // Does not exist yet
Clients[group].addMessage(message);
Clients[Context.ConnectionId].addMessage(message);
IClientProxy proxy = Clients;
proxy.Invoke("addMessage", message);
IClientProxy proxy1 = Clients[group];
proxy1.Invoke("addMessage", message);
// Dynamic
InvokeOn.All.addMessage(message);
InvokeOn.Others.addMessage(message);
InvokeOn.Caller.addMessage(message);
InvokeOn.Group(group).addMessage(message);
InvokeOn.Client(Context.ConnectionId).addMessage(message);
// Indirect
Invoke("addMessage", message).On.All();
Invoke("addMessage", message).On.Others();
Invoke("addMessage", message).On.Caller();
Invoke("addMessage", message).On.Group(group);
Invoke("addMessage", message).On.Client(Context.ConnectionId);
// Dynamic
Clients.All.addMessage(message);
Clients.Others.addMessage(message);
Clients.Caller.addMessage(message);
Clients.Group(group).addMessage(message);
Clients.Client(Context.ConnectionId).addMessage(message);
// Indirect
Clients.Invoke("addMessage", message).On.All();
Clients.Invoke("addMessage", message).On.Others();
Clients.Invoke("addMessage", message).On.Caller();
Clients.Invoke("addMessage", message).On.Group(group);
Clients.Invoke("addMessage", message).On.Client(Context.ConnectionId);
// Dynamic
Connected.All.addMessage(message);
Connected.Others.addMessage(message);
Connected.Caller.addMessage(message);
Connected.Group(group).addMessage(message);
Connected.Client(Context.ConnectionId).addMessage(message);
// Indirect
Connected.Invoke("addMessage", message).On.All();
Connected.Invoke("addMessage", message).On.Others();
Connected.Invoke("addMessage", message).On.Caller();
Connected.Invoke("addMessage", message).On.Group(group);
Connected.Invoke("addMessage", message).On.Client(Context.ConnectionId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment