
The BIND command can be used to bind a TCP or UDP socket to a specific network interface or to remove binding. Binding only works if more than one network interfaces are enabled. Also, a socket must be allocated (by any means) for BIND to work. Binding creates a relationship between a socket and a physical network interface. In some cases binding happens implicitely. These are:
If BIND was never used on a socket, that socket is unbound by default which means that:
BIND has the following consequences if used on a socket:
A bounded socket reverts to "unbound" state if one of these events occur:
BIND requires two arguments. The first one is the socket handle, which specifies either a UDP or TCP socket. The second one is one of the words WLAN, ETH or NONE. If WLAN is given, the socket is bound to the WLAN interface. ETH binds it to the Ethernet interface, and NONE unbounds the socket so it can be used by both interfaces.
ERR_ARGUMENT if an argument was wrong.
ERR_NOT_OPEN if the socket is not allocated.
ERR_REJECTED if less than two network interfaces are enabled.
ERR_OK if everything works well.
BIND 101 WLAN
Binds socket handle 101 to the WLAN interface
BIND only makes sense on modules with more than one network interfaces.