• SuperSocket接收过滤器工厂(ReceiveFilterFactory)


    接收过滤器工厂(ReceiveFilterFactory)用于为每个会话创建接收过滤器. 定义一个过滤器工厂(ReceiveFilterFactory)类型, 你必须实现接口 IReceiveFilterFactory. 类型参数 "TRequestInfo" 是你要在整个程序中使用的请求类型

    /// <summary>

    /// Receive filter factory interface

    /// </summary>

    /// <typeparam name="TRequestInfo">定义的请求类型 </typeparam>

    public interface IReceiveFilterFactory<TRequestInfo> : IReceiveFilterFactory

        where TRequestInfo : IRequestInfo

    {

        /// <summary>

        /// 创建接收过滤器

        /// </summary>

        /// <param name="appServer">The app server.</param>

        /// <param name="appSession">The app session.</param>

        /// <param name="remoteEndPoint">远程端点.</param>

        /// <returns>

    /// the new created request filer assosiated with this socketSession

    ///新建的请求过滤器与SocketSession产生关联

        /// </returns>

        IReceiveFilter<TRequestInfo> CreateFilter(IAppServer appServer, IAppSession appSession, IPEndPoint remoteEndPoint);

    }

    你也可以直接使用默认的过滤器工厂(ReceiveFilterFactory)

    DefaultReceiveFilterFactory<TReceiveFilter, TRequestInfo>

    , 当工厂的CreateFilter方法被调用时,它将会调用TReceiveFilter类型的无参构造方法来创建并返回TReceiveFilter.

  • 相关阅读:
    编写ocx出现未能注册输出。请确保您有修改注册表的相应权
    电子商务网站交互设计
    浅析Spring AOP
    ubuntu aptget
    URL对SEO的影响
    向各大搜索引擎提交你的网站
    站长SEO常用查询工具
    ubuntu关机重启命令
    vi中:x和:wq的区别
    RPM/AlienHowto
  • 原文地址:https://www.cnblogs.com/fanweisheng/p/11126654.html
Copyright © 2020-2023  润新知