zoukankan      html  css  js  c++  java
  • 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/

  • 相关阅读:
    sencha touch 视图(view) activate与deactivate事件探讨
    sencha touch Demo(示例)(2014-6-25)
    sencha touch NavigationView 源码详解(注释)
    sencha touch Model validations(模型验证,自定义验证)
    sencha touch routes(路由) 传递中文参数
    第二步 使用Cordova 3.0(及以上版本) 创建安卓项目(2014-6-25)
    sencha touch datepicker/datepickerfield(时间选择控件)扩展(废弃 仅参考)
    sencha touch list ListPaging使用详解
    sencha touch list更新单行数据
    sencha touch list tpl 监听组件插件(2013-9-15)
  • 原文地址:https://www.cnblogs.com/wyxy2005/p/2914033.html
Copyright © 2011-2022 走看看