Last active
August 29, 2015 14:01
-
-
Save thecopy/19a474b6d26d527999e8 to your computer and use it in GitHub Desktop.
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 Microsoft.AspNet.SignalR; | |
using Microsoft.Owin.Hosting; | |
using Owin; | |
namespace SignalRSelfHost | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// This will *ONLY* bind to localhost, if you want to bind to all addresses | |
// use http://*:8080 to bind to all addresses. | |
// See http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx | |
// for more information. | |
string url = "http://localhost:8080"; | |
using (WebApp.Start(url)) | |
{ | |
Console.WriteLine("Server running on {0}", url); | |
Console.ReadLine(); | |
} | |
} | |
} | |
class Startup | |
{ | |
public void Configuration(IAppBuilder app) | |
{ | |
app.MapSignalR(); | |
} | |
} | |
public class MyHub : Hub | |
{ | |
public void SomeFunction(MemberInformation member) | |
{ | |
Clients.All.functionOneClient(new MemeberInformation("hehe", member.LastName)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment