def discovery_agent(rpyc_port):
    data = struct.pack("<H", rpyc_port)

    # listen
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    s.bind(("", UDP_DISCOVERY_PORT))
    log("discovery_agent: started")
    
    # serve
    while True:
        query, addr = s.recvfrom(MAX_DGRAM_SIZE)
        if query == QUERY_MAGIC:
            log("discovery_agent: now answering", addr)
            s.sendto(data, addr)
answers broadcasted queries with the port of the RPyC server on this machine.
dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/python/Lib/site-packages/Rpyc/Utils/Serving.py/discovery_agent