Developer

API Reference

INETMGR_SelectNetwork()

Brew Release
Brew MP 1.0.2
See Also
INETMGR_SetOpt() Data networks
Description
Selects a specific data network.
Parameters
  • pINetMgr
    []:
    Pointer to the INetMgr Interface of interest
  • nNetwork
    []:
    AEE_NETWORK_*
Interface
INETMGR
Prototype
    int INETMGR_SelectNetwork
    (
      INetMgr *pINetMgr,
      int nNetwork,
    );
Return
SUCCESS: if the data network was selected AEE_NET_EINVAL: if the network is not valid AEE_NET_EOPNOTSUPP: if the network has already been selected. EFAILED: or other error code, otherwise
Side Effect
None.
Comment
Most applications will not need to explicitly select the network.
When an INetMgr instance is created, no network is selected. If an INetMgr method that requires a network is called before INETMGR_SelectNetwork(), AEE_NETWORK_DEFAULT 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 INETMGR_SelectNetwork(), or implicitly as described above, the network may not be changed. Hence, sockets opened by this INetMgr will be attached to the selected network. To use a different network, a new INetMgr instance is required.
Note that ISockPort sockets are not tied to INetMgr, and each ISockPort may use ISOCKPORT_SelectNetwork() independently to select a network.
INETMGR_SelectNetwork is not a formal member of INetMgr; instead it is a wrapper around INETMGR_SetOpt().
  • Follow