def serve(self):
        self._socket.listen(5)

        def _signal_handler(signal_number, stack_frame):
            self._is_serving = False

        signal.signal(signal.SIGINT, _signal_handler)
        signal.signal(signal.SIGTERM, _signal_handler)

        self._logger.info("Starting connection service...")

        while self._is_serving:
            try:
                connection, address = self._socket.accept()
            except socket.error as e:
                if e.errno == errno.EINTR:
                    self._logger.warning("Interrupting connection service.")
                else:
                    self._logger.warning(
                        "Error detected while establishing new connection."
                    )
                    self._logger.exception(e)
                break
            except Exception as e:
                self._logger.warning(
                    "Error detected while establishing new connection."
                )
                self._logger.exception(e)
            else:
                self._setup_connection_handler(connection, address)

        self._logger.info("Stopping connection service.")
Serve client connections.
dataset/ETHPy150Open OpenKMIP/PyKMIP/kmip/services/server/server.py/KmipServer.serve