This function sets, for the specified system object, how a host server port lookup will be done.
UINT CWB_ENTRY cwbCO_SetPortLookupMode( cwbCO_SysHandle system, cwbCO_PortLookupMode mode );
The latter two modes eliminate the iSeries server mapper connection and its associated delay, network traffic, and load on the iSeries system.
The following list shows common return values:
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.
Use CWBCO_PORT_LOOKUP_SERVER to be most certain of the accuracy of the port number for a service; however, this requires an extra connection to the server mapper on the iSeries system every time a new connection to a service is to be made.
Use CWBCO_PORT_LOOKUP_STANDARD to achieve the best performance, although if the system administrator has changed the ports of any iSeries Access host service in the service table on that iSeries system, this mode will not work.
Use CWBCO_PORT_LOOKUP_LOCAL for best performance when the port for a iSeries Access host service has been changed on the iSeries system represented by the system object. For this to work, entries for each host service port must be added to a file on the PC named SERVICES. Each such entry must contain first the standard name of the host service (for example, "as-rmtcmd" without the quotes) followed by spaces and the port number for that service. The SERVICES file is located in a subdirectory under the Windows® install directory called system32\drivers\etc.