From 4d5c8e0b1835be586b2d57d7db0953110d166a14 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Fri, 26 Mar 2021 17:56:08 +0100 Subject: This renames PacketPeerUDP.listen to bind. --- doc/classes/PacketPeerUDP.xml | 44 +++++++++++++++++++++---------------------- doc/classes/UDPServer.xml | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/PacketPeerUDP.xml b/doc/classes/PacketPeerUDP.xml index 2ea5c8a0a4..5d059ad3df 100644 --- a/doc/classes/PacketPeerUDP.xml +++ b/doc/classes/PacketPeerUDP.xml @@ -9,11 +9,27 @@ + + + + + + + + + + + Binds this [PacketPeerUDP] to the specified [code]port[/code] and [code]address[/code] with a buffer size [code]recv_buf_size[/code], allowing it to receive incoming packets. + If [code]address[/code] is set to [code]"*"[/code] (default), the peer will be bound on all available addresses (both IPv4 and IPv6). + If [code]address[/code] is set to [code]"0.0.0.0"[/code] (for IPv4) or [code]"::"[/code] (for IPv6), the peer will be bound to all available addresses matching that IP type. + If [code]address[/code] is set to any valid address (e.g. [code]"192.168.1.101"[/code], [code]"::1"[/code], etc), the peer will only be bound to the interface with that addresses (or fail if no interface with the given address exists). + + - Closes the UDP socket the [PacketPeerUDP] is currently listening on. + Closes the [PacketPeerUDP]'s underlying UDP socket. @@ -49,18 +65,18 @@ Returns the port of the remote peer that sent the last packet(that was received with [method PacketPeer.get_packet] or [method PacketPeer.get_var]). - + - Returns [code]true[/code] if the UDP socket is open and has been connected to a remote address. See [method connect_to_host]. + Returns whether this [PacketPeerUDP] is bound to an address and can receive packets. - + - Returns whether this [PacketPeerUDP] is listening. + Returns [code]true[/code] if the UDP socket is open and has been connected to a remote address. See [method connect_to_host]. @@ -87,22 +103,6 @@ Removes the interface identified by [code]interface_name[/code] from the multicast group specified by [code]multicast_address[/code]. - - - - - - - - - - - Makes this [PacketPeerUDP] listen on the [code]port[/code] binding to [code]bind_address[/code] with a buffer size [code]recv_buf_size[/code]. - If [code]bind_address[/code] is set to [code]"*"[/code] (default), the peer will listen on all available addresses (both IPv4 and IPv6). - If [code]bind_address[/code] is set to [code]"0.0.0.0"[/code] (for IPv4) or [code]"::"[/code] (for IPv6), the peer will listen on all available addresses matching that IP type. - If [code]bind_address[/code] is set to any valid address (e.g. [code]"192.168.1.101"[/code], [code]"::1"[/code], etc), the peer will only listen on the interface with that addresses (or fail if no interface with the given address exists). - - @@ -129,7 +129,7 @@ - Waits for a packet to arrive on the listening port. See [method listen]. + Waits for a packet to arrive on the bound address. See [method bind]. [b]Note:[/b] [method 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: [codeblocks] [gdscript] diff --git a/doc/classes/UDPServer.xml b/doc/classes/UDPServer.xml index 931aa71332..6f3ccb8a17 100644 --- a/doc/classes/UDPServer.xml +++ b/doc/classes/UDPServer.xml @@ -152,7 +152,7 @@ - Starts the server by opening a UDP socket listening on the given port. You can optionally specify a [code]bind_address[/code] to only listen for packets sent to that address. See also [method PacketPeerUDP.listen]. + Starts the server by opening a UDP socket listening on the given port. You can optionally specify a [code]bind_address[/code] to only listen for packets sent to that address. See also [method PacketPeerUDP.bind]. -- cgit v1.2.3