@staticmethod
    def __listen_forever(port, callback):
        sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        try:
            sock.bind(("127.0.0.1", port))
            while True:
                data, addr = sock.recvfrom(1024)  # pylint: disable=unused-variable
                callback(data.decode("utf-8"))
        finally:
            sock.close()
Listens to a given port, and calls callback in case a message
dataset/ETHPy150Open tobspr/RenderPipeline/rpcore/util/network_communication.py/NetworkCommunication.__listen_forever