/// <summary>
 /// 初始化
 /// </summary>
 private void Init()
 {
     this.apiActionList      = new ApiActionList(Common.GetServiceApiActions(this.GetType()));
     this.packetIdProvider   = new PacketIdProvider();
     this.taskSetActionTable = new TaskSetActionTable();
     this.Serializer         = new DefaultSerializer();
 }
 /// <summary>
 /// 快速构建Tcp服务端
 /// </summary>
 public FastTcpClient()
 {
     this.apiActionList      = new ApiActionList(FastTcpCommon.GetServiceApiActions(this.GetType()));
     this.packetIdProvider   = new PacketIdProvider();
     this.taskSetActionTable = new TaskSetActionTable();
     this.Serializer         = new DefaultSerializer();
 }
 /// <summary>
 /// 服务器的客户端对象
 /// </summary>
 /// <param name="serializer">序列化工具</param>
 /// <param name="packetIdProvider">数据包id提供者</param>
 /// <param name="taskSetActionTable">任务行为表</param>
 /// <param name="filterAttributeProvider">特性过滤器提供者</param>
 internal FastSession(PacketIdProvider packetIdProvider, TaskSetActionTable taskSetActionTable, ISerializer serializer, IFilterAttributeProvider filterAttributeProvider)
 {
     this.packetIdProvider        = packetIdProvider;
     this.taskSetActionTable      = taskSetActionTable;
     this.Serializer              = serializer;
     this.FilterAttributeProvider = filterAttributeProvider;
 }
Exemple #4
0
 /// <summary>
 /// 初始化
 /// </summary>
 private void Init()
 {
     this.apiActionTable   = new ApiActionTable(Common.GetServiceApiActions(this.GetType()));
     this.packetIdProvider = new PacketIdProvider();
     this.taskSetterTable  = new TaskSetterTable <long>();
     this.Serializer       = new DefaultSerializer();
     this.TimeOut          = TimeSpan.FromSeconds(30);
 }
Exemple #5
0
        /// <summary>
        /// 快速构建Tcp服务端
        /// </summary>
        public FastTcpServer()
        {
            this.apiActionList      = new ApiActionList();
            this.packetIdProvider   = new PacketIdProvider();
            this.taskSetActionTable = new TaskSetActionTable();

            this.Serializer = new DefaultSerializer();
            this.FilterAttributeProvider = new FilterAttributeProvider();
        }
Exemple #6
0
        /// <summary>
        /// 释放资源
        /// </summary>
        public override void Dispose()
        {
            base.Dispose();

            this.apiActionTable = null;
            this.taskSetterTable.Clear();
            this.taskSetterTable  = null;
            this.packetIdProvider = null;
            this.Serializer       = null;
        }
        /// <summary>
        /// 释放资源
        /// </summary>
        /// <param name="disposing">是否也释放托管资源</param>
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (disposing)
            {
                this.apiActionList = null;

                this.taskSetActionTable.Clear();
                this.taskSetActionTable = null;

                this.packetIdProvider = null;
                this.Serializer       = null;
            }
        }