Automobile.Mobile.Framework.Device.MobileDevice.HandleConnection C# (CSharp) Метод

HandleConnection() приватный Метод

Handles a connection, returns when the connection is closed
private HandleConnection ( ) : void
Результат void
        private void HandleConnection()
        {
            while (_communicator.Connected)
            {
                IResponse response;
                Command message;

                // Get a command
                try
                {
                    message = _communicator.WaitForMessage<Command>();
                }
                catch(TimeoutException)
                {
                    // Timed out waiting for a message
                    Browser.Navigate("about:blank", false);
                    _communicator.Close();
                    return;
                }

                // Handle the command
                try
                {
                    response = HandleMessage(message);
                }
                catch (ThreadAbortException)
                {
                    throw; // Shutting down
                }
                catch (Exception e)
                {
                    response = message.CreateResponse(e);
                }

                if(response != null)
                {
                    _communicator.SendResponse(response);
                }

            }
        }