Skip to content

Instantly share code, notes, and snippets.

@davidfowl
Last active December 16, 2015 03:19
Show Gist options
  • Select an option

  • Save davidfowl/5369429 to your computer and use it in GitHub Desktop.

Select an option

Save davidfowl/5369429 to your computer and use it in GitHub Desktop.
Blog post Beta 1.1
using System.Diagnostics;
using Microsoft.AspNet.SignalR;
namespace Microsoft.AspNet.SignalR.Samples
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
var config = new RedisScaleoutConfiguration("127.0.0.1", 6379, "", "MyApplication");
config.RetryOnError = true;
config.OnError = ex =>
{
Trace.TraceError(ex.ToString());
};
GlobalHost.DependencyResolver.UseRedis(config);
}
}
}
using System;
using System.Linq;
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs;
namespace MyApp
{
public class Chat : Hub
{
public void Send(string message)
{
Clients.All.send(message);
}
}
}
using Microsoft.AspNet.SignalR;
namespace Microsoft.AspNet.SignalR.Samples
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
string connectionString = "Data Source=(local);Initial Catalog=MyDatabase;Integrated Security=SSPI;Asynchronous Processing=True;";
GlobalHost.DependencyResolver.UseSqlServer(connectionString);
}
}
}
<system.diagnostics>
<sources>
<source name="SignalR.SqlMessageBus">
<listeners>
<add name="SignalR-Bus" />
</listeners>
</source>
<source name="SignalR.ServiceBusMessageBus">
<listeners>
<add name="SignalR-Bus" />
</listeners>
</source>
<source name="SignalR.ScaleoutMessageBus">
<listeners>
<add name="SignalR-Bus" />
</listeners>
</source>
</sources>
<switches>
<add name="SignalRSwitch" value="Verbose" />
</switches>
<sharedListeners>
<add name="SignalR-Bus"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="bus.log.txt" />
</sharedListeners>
<trace autoflush="true" />
</system.diagnostics>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment