Purpose
This function sets, for the specified system
object, when iSeries™ Access
for Windows® dynamically
will lookup the iSeries system's
IP address when a connection is to be made. If the system name that is specified
when cwbCO_CreateSystem or cwbCO_CreateSystemLike was
called is an actual IP address, this setting is ignored, because iSeries Access
for Windows never
needs to lookup the address.
Syntax
UINT CWB_ENTRY cwbCO_SetIPAddressLookupMode(
cwbCO_SysHandle system,
cwbCO_IPAddressLookupMode mode );
Parameters
- cwbCO_SysHandle system - input
- Handle that previously was returned from cwbCO_CreateSystem or cwbCO_CreateSystemLike.
It identifies the iSeries system.
- cwbCO_IPAddressLookupMode mode - input
- Specifies when the dynamic address lookup can occur. Possible values are:
- CWBCO_IPADDR_LOOKUP_ALWAYS
- Every time a connection is to occur, dynamically lookup the iSeries system's
IP address.
- CWBCO_IPADDR_LOOKUP_1HOUR
- Lookup the IP address dynamically if it has been at least one hour since
the last lookup for this iSeries system.
- CWBCO_IPADDR_LOOKUP_1DAY
- Lookup the IP address dynamically if it has been at least one day since
the last lookup for this iSeries system.
- CWBCO_IPADDR_LOOKUP_1WEEK
- Lookup the IP address dynamically if it has been at least one week since
the last lookup for this iSeries system.
- CWBCO_IPADDR_LOOKUP_NEVER
- Never dynamically lookup the IP address of this iSeries system, always use the IP address
that was last used for this iSeries system on this PC.
- CWBCO_IPADDR_LOOKUP_AFTER_STARTUP
- Lookup the IP address dynamically if Windows has been re-started since the
last lookup for this iSeries system.
Return Codes
The following list shows common return
values:
- CWB_OK
- Successful completion.
- CWB_INVALID_API_HANDLE
- Invalid system handle.
- CWB_INVALID_PARAMETER
- The mode parameter is an invalid value.
- CWB_RESTRICTED_BY_POLICY
- A policy exists that prohibits the user from changing this value.
- CWB_INV_AFTER_SIGNON
- Signon has successfully occurred by using the specified system object,
so this setting no longer may be changed.
Usage
This API cannot be used after a successful
signon has occurred for the specified system object. A signon has occurred
if either cwbCO_Signon or cwbCO_Connect has
been called successfully for this system object.
Setting this to a value
other than CWB_IPADDR_LOOKUP_ALWAYS could shorten the time to connect to the iSeries system,
since the dynamic lookup may cause network traffic and take many seconds to
complete. If the dynamic lookup is not performed, there is a risk that the
IP address of the iSeries system will have changed and a connection
will either fail or will be made to the wrong iSeries system.