C#交流俱乐部

学习为主,互相帮助

博客园 首页 新随笔 联系 订阅 管理

Signalr项目结构

•Microsoft.AspNet.SignalR – meta package (use this)
•Microsoft.AspNet.SignalR.Client – .NET 4 and WinRT client
•Microsoft.AspNet.SignalR.JS – The Javascript client.
•Microsoft.AspNet.SignalR.Core – Core server package with no host implementation
•Microsoft.AspNet.SignalR.Hosting.AspNet – The ASP.NET host
•Microsoft.AspNet.SignalR.Hosting.Utils – utilities for signalr (signalr.exe)
•Microsoft.AspNet.SignalR.Redis – Redis message bus implementation
•Microsoft.AspNet.SignalR.ServiceBus – Service bus message bus implementation
•-------------------------------
•使用Knockout.js 和MVC完美实现MVVM模式
•Nuget 和Git
 
Hub Pipeline  实现任何消息incoming和outgoing的拦截
namespace MySignalRApplication
{ public class Global : System.Web.HttpApplication
    {   protected void Application_Start(object sender, EventArgs e)
        {
    –GlobalHost.HubPipeline.AddModule(new LoggingPipelineModule());
    }
    }
    public class LoggingPipelineModule : HubPipelineModule
    {  protected override bool OnBeforeIncoming(IHubIncomingInvokerContext context)
        {
            Debug.WriteLine("=> Invoking " + context.MethodDescriptor.Name + " on hub " + context.MethodDescriptor.Hub.Name);
            return base.OnBeforeIncoming(context);
        }         
    protected override bool OnBeforeOutgoing(IHubOutgoingInvokerContext context)
        {  Debug.WriteLine("<= Invoking " + context.Invocation.Method + " on client hub " + context.Invocation.Hub);    return base.OnBeforeOutgoing(context);
        }  }
}
 
路由注册,使用了NET 4.0的新特性,默认的路由
[assembly: PreApplicationStartMethod(typeof(MySignalRApplication.RegisterHubs), "Start")]
namespace MySignalRApplication
{
    public static class RegisterHubs
    {
        public static void Start()
        {
            // Register the default hubs route: ~/signalr/hubs
            RouteTable.Routes.MapHubs();
        }
    }
}
 
其他资源

网易开源的Pomelo

https://github.com/NetEase/pomelo

Pomelo 是基于node.js的高性能,分布式游戏服务器框架。包括基础的开发框架和相关的扩展组件(库和工具包),可以帮助你省去游戏开发枯燥中的重复劳动和底层逻辑的开发。 pomelo不但适用于游戏服务器开发, 也可用于开发高实时web应用,它的分布式架构可以使pomelo比普通的实时web框架扩展性更好。

Pushlet:开源 comet 框架,使用观察者模型,浏览器端提供了基于 AJAX 和 iframe 的 JavaScript 库,服务器端使用 Java Servlet  地址:http://www.pushlets.com/

posted on 2013-02-17 10:54  bluce chen  阅读(1525)  评论(0编辑  收藏  举报