Exemplo n.º 1
0
 private void HandleSetCredentialMessage(WebSocketClient client, MiqiMessage message)
 {
     string reqClientId = message.GetHeader("ClientId");
     WebSocketClient reqClient = m_server.GetClientById(reqClientId);
     if (reqClient != null) {
         reqClient.Send(MiqiMessage.BuildSetCredential(message).ToString());
         client.Disconnect();
     } else {
         m_logForm.Log("Cannot find the client: {0}", reqClientId);
     }
 }
Exemplo n.º 2
0
        private void OnReceivedTextualData(WebSocketClient client, string data)
        {
            m_logForm.Log("Client {0} Received message...", client.Id);
            // Console.WriteLine("Client {0} Received message... {1}", client.Id, data);

            try
            {
                MiqiMessage message = MiqiMessage.BuildFromString(data);
                m_msgHandlers.HandleMessage(client, message);
            }
            catch (Exception ex)
            {
                m_logForm.Log("OnReceivedTextualData: {0}", ex.Message);
                client.Disconnect();
            }
        }