SocketCore.NetworkInterface

From Xojo Documentation

Property (As NetworkInterface )
aSocketCore.NetworkInterface = newNetworkInterfaceValue
or
NetworkInterfaceValue = aSocketCore.NetworkInterface

Supported for all project types and targets.

Specifies which network interface the socket should use when binding.

Notes

You can get the network interface(s) of the user’s computer by calling the GetNetworkInterface method of the System module.

Leaving this property set to Nil will use the currently selected interface. In the case of UDPSockets, if you assign a non-Nil value, the socket may not be able to receive broadcast messages. The behavior is OS-dependent; it appears to work on Windows but not on other supported operating systems. If you wish to send broadcast packets out, then you should not bind to a specific interface because the behavior is undefined.

Example

This example specifies that the TCPSocket will use the first Network Interface on the user’s computer.

TCPSocket1.NetworkInterface=System.GetNetworkInterface(0)