Ejemplo n.º 1
0
        private void HandleMessage(byte messageCode, IDictionary <byte, object> values, bool isResponse)
        {
            var message = serializer.FromMessageData(messageCode, values);

            if (message != null)
            {
                Action <INetworkMessage, bool> handler = null;
                if (messageHandlers.TryGetValue(message.GetType(), out handler))
                {
                    handler(message, isResponse);
                }
            }
        }
Ejemplo n.º 2
0
        protected override void OnOperationRequest(OperationRequest operationRequest, SendParameters sendParameters)
        {
            var message = serializer.FromMessageData(operationRequest.OperationCode, operationRequest.Parameters);

            if (message != null)
            {
                Action <INetworkMessage> handler = null;
                if (messageHandlers.TryGetValue(message.GetType(), out handler))
                {
                    handler(message);
                }
            }
        }