|
|
|
|
The lu0_write function sends data from the LU0 application's LU to the host. LU0 sends the data to the host as a chain, splitting it into multiple RUs if necessary.
int lu0_write (
AP_UINT32 *handle,
int options,
LU0_CALLBACK callback,
void *user,
int buffer_length,
char *buffer,
int *qualifier
);
The application supplies the following parameters:
The identifier that was returned on the original lu0_init function call for the LU0 session.
Reserved (this parameter must be set to zero).
To use the synchronous version of lu0_write, specify a NULL pointer.
To use the asynchronous version of lu0_write, specify a pointer to a callback routine within the application. See Synchronous and Asynchronous LU0 Operation for more details.
This parameter is used only for asynchronous calls.
A pointer to an optional user data string supplied by the application; typically used for the application's session identifier or for a pointer to a control block. The format of this data is defined by the application; SNAP-IX does not use this data, but returns it unchanged as a parameter to the callback routine when returning information related to this function call. This allows the application to correlate the callback with the original request.
The length in bytes of the supplied data buffer. To send a null RU chain, specify a length of zero.
Address of a data area containing the data to be sent. If buffer_length is zero, the application can supply a NULL pointer.
If the application uses the asynchronous version of lu0_write , the data area must remain valid until the callback function has completed. This means that the data area must not be declared on the stack.
LU0 does not modify the supplied data.
If a callback routine was specified, the function does not block, and returns a value to indicate whether the function was issued successfully. If it was successful, the result of the write operation is then reported using the application's callback routine.
The function returns one of the following values:
The function was issued successfully. The result of sending the data (or a session failure event if this occurs first) will be reported to the application using the supplied callback routine.
LU0 could not process the function, either because the application supplied parameters that were not valid (for example, it tried to issue a second lu0_write before the first has completed) or because an error occurred within SNAP-IX. The SNAP-IX error log file contains more details of the error. The supplied callback routine will not be called for this function. No data was sent.
The asynchronous version of lu0_write does not return any parameters. The application can supply a null pointer for the qualifier parameter.
If the return value from the lu0_write function is LU0_EVENT_IN_PROGRESS, LU0 calls the application's callback routine when the data has been sent (and a response has been received if the application required one), or to report a subsequent session failure. The parameters supplied to the callback routine are as follows.
The session handle that was returned on the lu0_init function.
The user data that was supplied on the lu0_write function. This allows the application to correlate the callback with the original request.
The event being reported. This is one of the following:
The data has been sucessfully sent to the host (and a response has been received if the application required one). The application can re-use or free the data buffer, either within the callback routine or in the main processing path.
This return code does not imply that the host sent a positive response
to the data. If the application used the
The application issued lu0_term (or lu0_init to restart the session) while lu0_write was outstanding. No data will be returned.
The session termination event is reported to the lu0_write function's callback routine to ensure that the routine is always called once, and to allow the application to do any cleanup processing specific to this routine.
If the application used the
If a callback routine was not specified, the function blocks until the
data has successfully been sent to the host (and, if the application used
the
The function returns one of the following values:
The data has been sucessfully sent to the host (and a response has been received if the application required one).
This return code does not imply that the host sent a positive response
to the data. If the application used the
LU0 could not process the function, either because the application supplied parameters that were not valid or because an error occurred within SNAP-IX. The SNAP-IX error log file contains more details of the error. The data was not sent.
The session failed, or an UNBIND was received from the host, before lu0_write was issued or while it was outstanding.
The application must not issue any further lu0_write
calls. It may issue lu0_read calls, typically with the
To terminate the session, it issues lu0_term.
To restart the session, it issues lu0_init using the existing session handle and LU name.
The data was sent successfully, and the host has sent SHUTD.
The application can use further lu0_write function
calls to send any outstanding data. It can also issue lu0_read
calls, typically with the
To terminate the session, it issues lu0_term.
To restart the session, it issues lu0_init using the existing session handle and LU name.
LU0 returns the following parameters.
This parameter contains an SNA sense code if one of the following is true:
If the return value is LU0_EVENT_WRITE_SESS_FAIL , this parameter contains the SNA sense code or LU0-specific sense code associated with the failure, if one is available.
If the return value is LU0_EVENT_WRITE_OK
or LU0_EVENT_WRITE_SHUTD, and the application used
the
In all other cases, this parameter is not used.
|
|
|
|
|