PacketPeerUDP.wait

Waits for a packet to arrive on the listening port. See listen. Note: wait can't be interrupted once it has been called. This can be worked around by allowing the other party to send a specific "death pill" packet like this:

More...
struct PacketPeerUDP
@nogc nothrow
GodotError
wait
()

Detailed Description

# Server socket.set_dest_address("127.0.0.1", 789) socket.put_packet("Time to stop".to_ascii())

# Client while socket.wait() == OK: var data = socket.get_packet().get_string_from_ascii() if data == "Time to stop": return

Meta