def METHOD_NAME(self):
    try:
        while 1:
            if self.host is None:
                return
            try:
                event = self.host.service(0)
            except IOError:
                break
            if event is None:
                break
            event_type = event.type
            if event_type == enet.EVENT_TYPE_NONE:
                break
            peer = event.peer
            is_client = peer in self.clients
            if is_client:
                connection = self.clients[peer]
                if event_type == enet.EVENT_TYPE_CONNECT:
                    connection.on_connect()
                    connection.timeout_call.cancel()
                elif event_type == enet.EVENT_TYPE_DISCONNECT:
                    connection.on_disconnect()
                    del self.clients[peer]
                    self.check_client()
                elif event.type == enet.EVENT_TYPE_RECEIVE:
                    connection.loader_received(event.packet)
            else:
                if event_type == enet.EVENT_TYPE_CONNECT:
                    self.on_connect(peer)
                elif event_type == enet.EVENT_TYPE_DISCONNECT:
                    self.on_disconnect(peer)
                elif event.type == enet.EVENT_TYPE_RECEIVE:
                    self.data_received(peer, event.packet)
    except:
        # make sure the LoopingCall doesn't catch this and stops
        import traceback
        traceback.print_exc()