private void SocketListener_OnDataReceived(object sender, TEC.Core.Sockets.Core.DataReceivedEventArgs e)
        {
            JToken          jToken    = JToken.Parse(System.Text.Encoding.UTF8.GetString(e.DataHolder.Data));
            SocketEventType eventType = (SocketEventType)jToken["EventType"].Value <int>();
            string          eventName = jToken["EventName"].Value <string>();

            foreach (object handler in this.RegisteredSocketServerEventHandlers)
            {
                if (eventType == ((dynamic)handler).EventType && eventName == ((dynamic)handler).EventName)
                {
                    ((dynamic)handler).handle(this.SocketListener,
                                              this.ConnectedClientInfo.First(t => t.TokenId == e.TokenId), ((dynamic)handler).ValueConverter.convert(jToken.ToString()));
                }
            }
        }
        private void SocketClient_OnDataReceived(object sender, TEC.Core.Sockets.Core.DataReceivedEventArgs e)
        {
            ServerInfo serverInfo;

            lock (this.ConnectedServerInfo)
            {
                serverInfo = this.ConnectedServerInfo.FirstOrDefault(t => t.TokenId == e.TokenId);
            }
            if (serverInfo == null)
            {
                return;
            }
            JToken          jToken    = JToken.Parse(System.Text.Encoding.UTF8.GetString(e.DataHolder.Data));
            SocketEventType eventType = (SocketEventType)jToken["EventType"].Value <int>();
            string          eventName = jToken["EventName"].Value <string>();

            foreach (object handler in this.RegisteredSocketClientEventHandlers)
            {
                if (eventType == ((dynamic)handler).EventType && eventName == ((dynamic)handler).EventName)
                {
                    ((dynamic)handler).handle(this.SocketClient, serverInfo, ((dynamic)handler).ValueConverter.convert(jToken.ToString()));
                }
            }
        }