Created
April 22, 2015 23:31
-
-
Save toinetoine/5d3403ceb46f2e517525 to your computer and use it in GitHub Desktop.
Hub file from SignalR tutorial at http://www.antoinedahan.com/blog/SignalRAzureTutorial/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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