PacketPeerUDPWait Method |
Waits for a packet to arrive on the listening port. See Listen(Int32, String, Int32).
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:
# 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
Namespace: Godot
public Error Wait()
[Missing <returns> documentation for "M:Godot.PacketPeerUDP.Wait"]