wouterverweirder/AIR-Mobile-UDP-Extension

bind() should accept a second parameter for specifing the local IP address

Closed this issue · 2 comments

UDPSocket interface should be as compatible with the DatagramSocket interface as possible.

Particularly, DatagramSocket.bind() accepts a second parameter for specifing the local IP address to bind to. When the local host has more than one network interfaces, this is vital.

From DatagramSocket documentation:
"
bind () method
public function bind(localPort:int = 0, localAddress:String = "0.0.0.0"):void
Language Version: ActionScript 3.0
Runtime Versions: AIR 2
Binds this socket to the specified local address and port.

The bind() method executes synchronously. The bind operation completes before the next line of code is executed.

Parameters

localPort:int (default = 0) — The number of the port to bind to on the local computer. If localPort, is set to 0 (the default), the next available system port is bound. Permission to connect to a port number below 1024 is subject to the system security policy. On Mac and Linux systems, for example, the application must be running with root privileges to connect to ports below 1024.

localAddress:String (default = "0.0.0.0") — The IP address on the local machine to bind to. This address can be an IPv4 or IPv6 address. If localAddress is set to 0.0.0.0 (the default), the socket listens on all available IPv4 addresses. To listen on all available IPv6 addresses, you must specify "::" as the localAddress argument. To use an IPv6 address, the computer and network must both be configured to support IPv6. Furthermore, a socket bound to an IPv4 address cannot connect to a socket with an IPv6 address. Likewise, a socket bound to an IPv6 address cannot connect to a socket with an IPv4 address. The type of address must match.

this has been added in the latest github commit :)

wonderful :)