• 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/

  • 相关阅读:
    顺序栈--Java实现
    优先队列(存储结构数组)--Java实现
    队列(存储结构数组)--Java实现
    有序链表--Java实现
    双向链表--Java实现
    表达式求值--Java实现
    【Mac + Appium】之运行报错:[UiAutomator] UiAutomator exited unexpectedly with code 0, signal null
    【Mac + ATX基于uiautomator2】使用weditor时,报错:requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))
    【Mac系统 + Python + Django】之开发一个发布会系统【Django模型(三)】
    【转】【Mac系统】之ADB命令总结
  • 原文地址:https://www.cnblogs.com/wyxy2005/p/2914033.html
Copyright © 2020-2023  润新知