Host SignalR in IIS

Ich Frage mich nur, und es ist die Jagd, die mich für diese letzten Tage ist es möglich, Host-SignalR-Hub in IIS? ist dieses Ereignis möglich? ich habe eine Lösung gefunden, genannt "self-hosting" aber es ist mit Hilfe einer console-Anwendung. ich möchte Gastgeber der SignalR-Hub in meinem IIS-ist das möglich? kann jemand mir ein Beispiel in Bezug auf diese?

werde ich nach dem code für die self-Hosting-ich dachte, ich könnte helfen

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.UseCors(CorsOptions.AllowAll);
            app.MapSignalR();
        }
    }
    public class MyHub : Hub
    {
        public void Send(string name, string message)
        {
            Clients.All.addMessage(name, message);
        }
    }

InformationsquelleAutor bRaNdOn | 2014-10-17

Schreibe einen Kommentar