Example 2
Another application provides TN3270 emulation. It needs to locate a lightly-loaded server providing this service. The client's configuration is obtained from either an INI file or NDS: it's scope is ENGINEERING, and it needs to find an LU type 2 model 2 from the LU Pool SMITH_1.
The application begins by issuing an SL_GetAttrs call with the service type of TN3270: and an attribute tag filter of 'SCOPE'. This returns a list of scope values that the servers supporting TN3270 have been administrated for. For illustrative purposes, assume that the scope value of 'ENGINEERING' is returned on the SL_GetAttrs call. Next the application builds the following predicate for the SL_GetService request to locate a server within this scope, that satisfies its initial LU device type, and load requirements (in all examples '\t' is the TAB character):
tn3270/ENGINEERING/LUPOOL==SMITH_1\t3270002,LOAD <= 10/
The application is designed to locate in load increments of 10, so if the initial SL_GetService request returns an empty list, the application re-issues the SL_GetService specifying the service again plus the new load attribute.
tn3270/ENGINEERING/LUPOOL==SMITH_1\t3270002,LOAD <= 20/
At this point, a list of two URLs (similar to these) is returned (the port number 23 is the standard port for Telnet connection requests) :
service:tn3270://9.37.51.254:23
service:tn3270://9.37.51.260:23
The application does not care that the absolute least-loaded server be selected as long as its load is below 20%. Therefore, it selects one of the two returned URLs at random:
URL = service:tn3270://9.37.51.260:23
The application selects 9.37.52.260:23 as its connection target, and the connection is successful.