protected virtual void OnReciveTextPacket(WebSocketProtocol aSender, IWebSocketPacket e) { if (recivePacket != null) { recivePacket(aSender, e); } }
protected override void OnReciveTextPacket(WebSocketProtocol aSender, IWebSocketPacket e) { if (recivePacket != null) recivePacket(aSender, e); try { JsonObject lTextjson = new JsonObject(e.GetString()); IToken lToken = PacketToToken(e); string lType = lToken.GetType(); lock (PendingResponseQueue) { if (!lType.Equals(WebSocketMessage.WELCOME) && !lType.Equals(WebSocketMessage.GOODBYTE)) { try { int lUTID = lToken.GetInt(WebSocketMessage.UTID); int lCode = lToken.GetInt(WebSocketMessage.CODE); PendingResponseQueue lPRQI = PendingResponseQueue[lUTID]; if (lPRQI != null) { bool lSuccess = false; if (lCode == 0) lSuccess = true; TokenResponse lResponse = new TokenResponse(mPendingResponseQueue[lUTID].Token, lToken, lSuccess); lPRQI.PendingResponse.Invoke(this, lResponse); PendingResponseQueue.Remove(lUTID); } } catch (Exception) { } } } OnReciveTokenText(lToken); } catch (Exception) { } }
protected virtual void OnReciveTextPacket(WebSocketProtocol aSender, IWebSocketPacket e) { if (recivePacket != null) { recivePacket(aSender, e); } }