public void ProcessServerMessages()
        {
            if (server.Active)
            {
                server.GetNextMessages(queue);
                while (queue.Count > 0)
                {
                    Apathy.Message message = queue.Dequeue();
                    switch (message.eventType)
                    {
                    case Apathy.EventType.Connected:
                        OnServerConnected.Invoke(message.connectionId);
                        break;     // breaks switch, not while

                    case Apathy.EventType.Data:
                        OnServerDataReceived.Invoke(message.connectionId, message.data, Channels.DefaultReliable);
                        break;     // breaks switch, not while

                    case Apathy.EventType.Disconnected:
                        OnServerDisconnected.Invoke(message.connectionId);
                        break;     // breaks switch, not while
                    }
                }
            }
        }
        void ProcessClientMessages()
        {
            client.GetNextMessages(queue);
            while (queue.Count > 0)
            {
                Apathy.Message message = queue.Dequeue();
                switch (message.eventType)
                {
                case Apathy.EventType.Connected:
                    OnClientConnected.Invoke();
                    break;     // breaks switch, not while

                case Apathy.EventType.Data:
                    OnClientDataReceived.Invoke(message.data, Channels.DefaultReliable);
                    break;     // breaks switch, not while

                case Apathy.EventType.Disconnected:
                    OnClientDisconnected.Invoke();
                    break;     // breaks switch, not while
                }
            }
        }