[ Previous | Next | Contents | Search ]
3270 Host Connection Program 2.1 and 1.3.3 for AIX: Guide and Reference

PAUSE (18)

Purpose

Waits for a specified amount of time in any application where a time interval is desired between events. It should be used in place of timing loops to wait for an event to occur.

Prerequisite Calls

This function requires no prerequisite calls to other functions.

Syntax

hllc (func, apistring, len, ret)
int *func;
char *apistring;
int *len;
int *ret;

Supplied Parameters

Supply the following parameters to invoke the PAUSE function:

func Specifies the number of the function called; must be 18 for the PAUSE function.
apistring Specifies the attributes of the API string; the calling data string contains:
Position 1 One of the following:
  • A one-character PS short session ID of the PS for which the IPAUSE option has been requested
  • A blank or null character indicating that the IPAUSE option is not being used, or that IPAUSE has been requested for all sessions that have called the START HOST NOTIFICATION (23) function
len Contains the pause duration in half-second increments.
ret Does not apply for this function.

Returned Parameters

ret The following codes are valid:
0 Specifies that the wait duration has expired.
2 Indicates a parameter error occurred.
9 Indicates an internal system error occurred. The time results are unpredictable.
26 Specifies that the host session PS or OIA was updated; refer to the QUERY HOST UPDATE (24) function for more information.

Remarks

The PAUSE function has several options associated with it. To use the IPAUSE option for a specific session when multiple sessions are being monitored by the START HOST NOTIFICATION (23) function, place the short session ID of the session for which IPAUSE has been requested in the first position of the data string. As a result, the call to the PAUSE function will return only when an event on the specified session has occurred or the PAUSE function has timed out. For example, host events on other sessions will not cause an interruption of the PAUSE function.

Once a PAUSE function call has been satisfied by a host event, the QUERY HOST UPDATE (24) function should be called before PAUSE function is called again. All subsequent calls to the PAUSE function will return immediately with a return code of 26 until the QUERY HOST UPDATE (24) function is complete.

Applications that require a high-resolution timer should not use the PAUSE function. The time interval created by this function is approximate. The FPAUSE or IPAUSE option in the SET SESSION PARAMETERS (9) function affects the length of the pause that occurs when you call this function.

When a START function is called, the IPAUSE option can be used to make the application wait until the host PS or Operator Information Area (OIA), or both, has received an update. The PAUSE function terminates when this occurs and allows the application to issue a query function to determine what changed. The application can then issue a SEARCH PRESENTATION SPACE (6) function call to see if the expected update occurred.

If the START HOST NOTIFICATION (23) function is not enabled, the PAUSE function will wait for a specific amount of time and return to the application with return code 0.

The PAUSE function can be ended by a host event if a prior START HOST NOTIFICATION (23) function has been called. To interrupt the PAUSE application whenever the PS has been updated, set the IPAUSE option in conjunction with the enabling of the START HOST NOTIFICATION (23) function.

The IPAUSE option is used in conjunction with the following three functions to allow a HLLAPI application to determine if the designated host PS or OIA has been updated:

When using the FPAUSE option, the specified time interval will not be interrupted if a host update occurs before the interval expires. The FPAUSE option is the default.

Related Information

QUERY HOST UPDATE (24) function, START HOST NOTIFICATION (23) function and STOP HOST NOTIFICATION (25) function.


[ Previous | Next | Contents | Search ]