.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_PacketPeerUDP: PacketPeerUDP ============= **Inherits:** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` **Category:** Core Brief Description ----------------- UDP packet peer. Member Functions ---------------- +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`close` **(** **)** | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_packet_ip` **(** **)** const | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_packet_port` **(** **)** const | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_listening` **(** **)** const | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Error | :ref:`listen` **(** :ref:`int` port, :ref:`String` bind_address="*", :ref:`int` recv_buf_size=65536 **)** | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`set_send_address` **(** :ref:`String` host, :ref:`int` port **)** | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Error | :ref:`wait` **(** **)** | +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Description ----------- UDP packet peer. Can be used to send raw UDP packets as well as :ref:`Variant`\ s. Member Function Description --------------------------- .. _class_PacketPeerUDP_close: - void **close** **(** **)** Close the UDP socket the :ref:`PacketPeerUDP` is currently listening on. .. _class_PacketPeerUDP_get_packet_ip: - :ref:`String` **get_packet_ip** **(** **)** const Return the IP of the remote peer that sent the last packet(that was received with :ref:`get_packet` or :ref:`get_var`). .. _class_PacketPeerUDP_get_packet_port: - :ref:`int` **get_packet_port** **(** **)** const Return the port of the remote peer that sent the last packet(that was received with :ref:`get_packet` or :ref:`get_var`). .. _class_PacketPeerUDP_is_listening: - :ref:`bool` **is_listening** **(** **)** const Return whether this :ref:`PacketPeerUDP` is listening. .. _class_PacketPeerUDP_listen: - Error **listen** **(** :ref:`int` port, :ref:`String` bind_address="*", :ref:`int` recv_buf_size=65536 **)** Make this :ref:`PacketPeerUDP` listen on the "port" binding to "bind_address" with a buffer size "recv_buf_size". If "bind_address" is set as "\*" (default), the peer will listen on all available addresses (both IPv4 and IPv6). If "bind_address" is set as "0.0.0.0" (for IPv4) or "::" (for IPv6), the peer will listen on all available addresses matching that IP type. If "bind_address" is set to any valid address (e.g. "192.168.1.101", "::1", etc), the peer will only listen on the interface with that addresses (or fail if no interface with the given address exists). .. _class_PacketPeerUDP_set_dest_address: - :ref:`int` **set_dest_address** **(** :ref:`String` host, :ref:`int` port **)** Set the destination address and port for sending packets and variables, a hostname will be resolved using if valid. .. _class_PacketPeerUDP_wait: - :ref:`int` **wait** **(** **)** Wait for a packet to arrive on the listening port, see :ref:`listen`.