Пример #1
0
 /// <summary>
 /// FastWebSocket的客户端对象
 /// </summary>
 /// <param name="packetIdProvider"></param>
 /// <param name="taskSetActionTable"></param>
 /// <param name="jsonSerializer"></param>
 /// <param name="filterAttributeProvider"></param>
 internal FastWebSocketSession(PacketIdProvider packetIdProvider, TaskSetActionTable taskSetActionTable, IJsonSerializer jsonSerializer, IFilterAttributeProvider filterAttributeProvider)
 {
     this.packetIdProvider        = packetIdProvider;
     this.taskSetActionTable      = taskSetActionTable;
     this.JsonSerializer          = jsonSerializer;
     this.FilterAttributeProvider = filterAttributeProvider;
 }
Пример #2
0
        /// <summary>
        /// 快速构建WebSocket服务端
        /// </summary>
        public FastWebSocketServer()
        {
            this.apiActionList      = new ApiActionList();
            this.packetIdProvider   = new PacketIdProvider();
            this.taskSetActionTable = new TaskSetActionTable();

            this.JsonSerializer          = new DefaultJsonSerializer();
            this.FilterAttributeProvider = new FilterAttributeProvider();
        }
Пример #3
0
        /// <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.JsonSerializer          = null;
                this.FilterAttributeProvider = null;
            }
        }