- po:pointer to the ISockPort interface
- nNetwork:data network (AEE_NETWORK_*)
int ISockPort_SelectNetwork(ISockPort* po, int nNetwork)
AEE_NET_EINVAL : network is not valid AEE_NET_EOPNOTSUPP: network has already been selected
Other error codes are also possible.
When an ISockPort instance is created, no network is selected. If an ISockPort method that requires a network is called before ISockPort_SelectNetwork(), AEE_NETWORK_DEFAULT and the socket's family (or AEE_AF_INET if it's unspec) will be implicitly selected, and the decision of which network to actually use is deferred to lower layers. Decision will be made upon connection creation, depending on the device and/or service provider.
Once a network has been selected, either explicitly via ISockPort_SelectNetwork(), or implicitly as described above, the network may not be changed. To use a different network, a new ISockPort instance is required.