PacketPeerUDPConnectToHost Method |
Calling this method connects this UDP peer to the given host/port 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 SetDestAddress(String, Int32) are not allowed). This method does not send any data to the remote peer, to do that, use PutVar(Object, Boolean) or PutPacket(Byte) 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 transferring sensitive information.
Namespace: Godot
public Error ConnectToHost( string host, int port )
[Missing <param name="host"/> documentation for "M:Godot.PacketPeerUDP.ConnectToHost(System.String,System.Int32)"]
[Missing <param name="port"/> documentation for "M:Godot.PacketPeerUDP.ConnectToHost(System.String,System.Int32)"]
[Missing <returns> documentation for "M:Godot.PacketPeerUDP.ConnectToHost(System.String,System.Int32)"]