diff options
Diffstat (limited to 'doc/classes/PacketPeerUDP.xml')
-rw-r--r-- | doc/classes/PacketPeerUDP.xml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/classes/PacketPeerUDP.xml b/doc/classes/PacketPeerUDP.xml index 81cd341ef7..aa5599a3fb 100644 --- a/doc/classes/PacketPeerUDP.xml +++ b/doc/classes/PacketPeerUDP.xml @@ -16,6 +16,18 @@ Closes the UDP socket the [PacketPeerUDP] is currently listening on. </description> </method> + <method name="connect_to_host"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="host" type="String"> + </argument> + <argument index="1" name="port" type="int"> + </argument> + <description> + Calling this method connects this UDP peer to the given [code]host[/code]/[code]port[/code] pair. UDP is in reality connectionless, so this option only means that incoming packets from different addresses are automatically discarded, and that outgoing packets are always sent to the connected address (future calls to [method set_dest_address] are not allowed). This method does not send any data to the remote peer, to do that, use [method PacketPeer.put_var] or [method PacketPeer.put_packet] as usual. See also [UDPServer]. + Note: Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like SSL or DTLS if you feel like your application is transfering sensitive information. + </description> + </method> <method name="get_packet_ip" qualifiers="const"> <return type="String"> </return> @@ -30,6 +42,13 @@ 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]). </description> </method> + <method name="is_connected_to_host" qualifiers="const"> + <return type="bool"> + </return> + <description> + Returns [code]true[/code] if the UDP socket is open and has been connected to a remote address. See [method connect_to_host]. + </description> + </method> <method name="is_listening" qualifiers="const"> <return type="bool"> </return> |