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
public static class Bootstrapper | |
{ | |
internal static IKernel Kernel = null; | |
internal static NinjectDependencyResolver NinjectDependencyResolver = null; | |
public static void StrapTheBoot() | |
{ | |
var kernel = new StandardKernel(); | |
kernel.Bind(typeof(IGenericRepository<>)) | |
.To(typeof(GenericRepository<>)) |
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
// In Server | |
Console.WriteLine("Pinging " + item.Reciever.Name + "(" + connectionId + " ticket = " + item.Ticket + ")"); | |
GlobalHost.ConnectionManager.GetHubContext<ZombieHub>().Clients.Client(connectionId) | |
.Ping(item.Ticket); | |
// In Client | |
_hubProxy.On<Guid>("Ping", OnPing); |
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
// In Server | |
Console.WriteLine("Pinging " + item.Reciever.Name + "(" + connectionId + " ticket = " + item.Ticket + ")"); | |
GlobalHost.ConnectionManager.GetHubContext<ZombieHub>().Clients.Client(connectionId) | |
.Ping(item.Ticket); | |
// In Client | |
_hubProxy.On<Guid>("Ping", OnPing); |
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
_hubConnection = new HubConnection(url); | |
_hubProxy = _hubConnection.CreateHubProxy("ZombieHub"); | |
_hubProxy.On<Guid>("Ping", OnPing); | |
_hubConnection.Start().Wait(); |
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
Server Error in '/' Application. | |
Value cannot be null. | |
Parameter name: key | |
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. | |
Exception Details: System.ArgumentNullException: Value cannot be null. | |
Parameter name: key |
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
Enumerable.Range(0, range).ToList().ForEach(i => | |
{ | |
clients[i] = new ControllClient(LocalHostUrl); | |
clients[i].Connect(); | |
if(!clients[i].LogOn("username", "password")) // <----------- Here a ConnectedClient is added! | |
throw new AssertionFailure("Could not log on user " + i); | |
}); | |
var session = (ISession)Bootstrapper.Kernel.GetService(typeof(ISession)); | |
var user = session.Get<ControllUser>(1); | |
Assert.AreEqual(50, user.ConnectedClients.Count); // FAILS!! |
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
var options = new FormsAuthenticationOptions | |
{ | |
AuthenticationMode = AuthenticationMode.Active, | |
CookieHttpOnly = true, | |
CookieName = "controll.auth.id", | |
CookiePath = "/", | |
CookieSecure = CookieSecureOption.Never, | |
ExpireTimeSpan = TimeSpan.FromMinutes(10), | |
ReturnUrlParameter = "ReturnUrl", | |
SlidingExpiration = true, |
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
public class SessionHandlerPipelineModule : HubPipelineModule | |
{ | |
private readonly ISession _session; | |
private ITransaction _transaction; | |
public SessionHandlerPipelineModule(ISession session) | |
{ | |
_session = session; | |
} |
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
<html> | |
<head> | |
<title>SignalMan</title> | |
<script src="/Scripts/jquery-1.6.4.min.js"></script> | |
<script src="/Scripts/jquery.signalR-1.1.2.js"></script> | |
<script type="text/javascript"> | |
window.signalman = { connected: false, hub: null, argumentCount: 0 }; | |
$(function() { |
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
public static class MessageCenterOwinExtensions | |
{ | |
public static IAppBuilder UseMessageCenter(this IAppBuilder app, TinyIoCDependencyResolver resolver) | |
{ | |
var queueDocumentStore = new EmbeddableDocumentStore | |
{ | |
RunInMemory = true | |
}; | |
queueDocumentStore.Initialize(); |
OlderNewer