2013-09-04 08:02:58 +03:00
|
|
|
using System;
|
2013-05-06 00:24:33 +03:00
|
|
|
using Microsoft.AspNet.SignalR;
|
2013-05-11 02:53:50 +03:00
|
|
|
using NzbDrone.Common.Composition;
|
2013-09-11 09:33:47 +03:00
|
|
|
using NzbDrone.SignalR;
|
2013-05-05 00:09:25 +03:00
|
|
|
using Owin;
|
|
|
|
|
2013-08-07 08:32:22 +03:00
|
|
|
namespace NzbDrone.Host.Owin.MiddleWare
|
2013-05-05 00:09:25 +03:00
|
|
|
{
|
|
|
|
public class SignalRMiddleWare : IOwinMiddleWare
|
|
|
|
{
|
2013-05-06 00:24:33 +03:00
|
|
|
public int Order { get { return 0; } }
|
|
|
|
|
2013-09-11 09:33:47 +03:00
|
|
|
public SignalRMiddleWare(IContainer container)
|
2013-05-05 00:09:25 +03:00
|
|
|
{
|
2013-05-06 00:24:33 +03:00
|
|
|
SignalrDependencyResolver.Register(container);
|
2013-09-04 08:02:58 +03:00
|
|
|
|
|
|
|
GlobalHost.Configuration.DisconnectTimeout = TimeSpan.FromSeconds(300000);
|
2013-05-05 00:09:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public void Attach(IAppBuilder appBuilder)
|
|
|
|
{
|
2013-09-11 09:33:47 +03:00
|
|
|
appBuilder.MapConnection("signalr", typeof(NzbDronePersistentConnection), new ConnectionConfiguration { EnableCrossDomain = true });
|
2013-05-05 00:09:25 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|