Skip to content

Instantly share code, notes, and snippets.

@toinetoine
Created April 22, 2015 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toinetoine/5d3403ceb46f2e517525 to your computer and use it in GitHub Desktop.
Save toinetoine/5d3403ceb46f2e517525 to your computer and use it in GitHub Desktop.
Hub file from SignalR tutorial at http://www.antoinedahan.com/blog/SignalRAzureTutorial/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.AspNet.SignalR;
namespace SignalRExample.Hubs
{
public class ExampleHub : Hub
{
/* C# function AddComment(string) is called from jquery in index.html */
public void AddCommentToServer(string commentToAdd)
{
// Call back to AddNewComment jquery function for ALL clients
// (sends the parameter sent by each client to this function to all clients)
Clients.All.AddCommentLocal(commentToAdd);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment