Signalr中的代码笔记

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/

转载于:https://www.cnblogs.com/wyxy2005/archive/2013/02/17/2914033.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值