Szerkesztés

Megosztás a következőn keresztül:


WinAsyncAPPCIOCP

The WinAsyncAPPCIOCP function provides an asynchronous entry point for all of the APPC verbs. Use this function instead of the blocking versions of the verbs to allow multiple sessions to be handled on the same thread using I/O completion ports. This verb is only supported on Microsoft Windows, and uses Win32 I/O completion ports.

Syntax

  
    HANDLE WINAPI WinAsyncAPPCIOCP(   
APPC_IOCP_INFO *iocp_handle,  
longlpVcb);  

Parameters

iocp_handle
A pointer to an APPC_IOCP_INFO structure used for passing I/O completion port information.

lpVcb
Pointer to the verb control block

The APPC_IOCP_INFO structure has the following prototype:

  
APPC_CompletionPort;APPC_NumberOfBytesTransferred;  
    APPC_CompletionKey;  
    APPC_pOverlapped;  
  

APPC_CompletionPort

This supplied parameter is the HANDLE returned by the call to the CreateIoCompletionPort function when the I/O completion port is created. The I/O completion port must be created before calling the WinAsyncAPPCIOCP function. When the verb completes, the APPC Library calls the PostQueuedCompletionStatus function with the remaining fields in the structure as inputs, and these fields are simply passed through to the GetQueuedCompletionStatus function issued by the application.

APPC_NumberOfBytesTransferred

This supplied parameter is ignored. When the APPC verb completes, the APPC Library calls the PostQueuedCompletionStatus function with this field as an input, and the value returned for the dwNumberOfBytesTransferred is simply passed through to the GetQueuedCompletionStatus function issued by the application.

APPC_CompletionKey

This supplied parameter is ignored. When the APPC verb completes, the APPC Library calls the PostQueuedCompletionStatus function with this field as an input, and the value returned for the dwCompletionKey is simply passed through to the GetQueuedCompletionStatus function issued by the application.

APPC_pOverlapped

This supplied parameter is ignored. When the APPC verb completes, the APPC Library calls the PostQueuedCompletionStatus function with this field as an input, and the value returned for the lpOverlapped is simply passed through to the GetQueuedCompletionStatus function issued by the application.

Return Value

The return value specifies whether the asynchronous resolution request was successful. If the function was successful, the return value is an asynchronous task handle. If the function was not successful, a zero is returned.

When this function returns with a successful value, this does not indicate that the APPC call will ultimately return successfully. It only indicates that it was possible for the APPC library to attempt the APPC call asynchronously using an I/O completion port for notification.

Remarks

This function is intended for use with CreateIoCompletionPort and GetQueuedCompletionStatus in the Win32 API. These functions are described in the "Reference" section of the Microsoft Platform SDK documentation.

For an example of how to use this verb in multithreaded TPs, see the multithreaded receive sample TP (MRCVIO located in the SNA\MSENDRCV folder) using I/O completion ports included in the Host Integration Server SDK.

APPC verbs used in basic conversations that can block are as follows: