Condividi tramite


Completamento di una chiamata asincrona

Con un'eccezione, Microsoft® Host Integration Server consente una chiamata asincrona SNA di Windows® in sospeso per ogni connessione e un verbo di blocco per ogni thread. L'eccezione è che quando si esegue una chiamata di ricezione asincrona, è possibile eseguire le chiamate seguenti mentre receive è in sospeso:

void ProcessVerbCompletion (WPARAM wParam LPARAM lParam)  
{  
    for ( i = 0; i<nPendingVerbs; i++ )  
        if (memcmp  (pPending [i].ConvID, (Conversation_ID) lParam)== 0)  
            ProcessCommand  (wParam, lParam);  
}  
  
LRESULT CALLBACK SampleWndProc  ( . . .)  
{  
    if (msg = = uAsyncCPIC ) {  
        ProcessVerbCompletion (wParam, lParam);  
    }  
    else switch  (msg)  {  
       case WM_USER:  
        Initialize_Conversation (lpConvId, "GORDM", &lError  );  
        if  (lError  ! = CM_OK )   {  
            ErrorDisplay ( ) ;  
            break ;  
        }  
        Set_Processing_Mode (lpConvId, CM_NON_BLOCKING, &lError  ) ;  
        if  ( lError ! = CM_OK )  {  
            ErrorDisplay ( ) ;  
            break ;  
        }  
        Allocate  (lpConvId,  &lError )  ;  
        switch  (lError )  {  
        case CM_OK:  
            break ;  
        case CM_OPERATION_INCOMPLETE:  
            memcopy (pPending [nPending ++].ConvId, lpConvId, sizeof (C) ;  
            break ;  
        default:  
            ErrorDisplay ( ) ;  
        }  
        break ;  
}  
WinMain  ( . . . )  
{  
    if  ( ( WinCPICStartup  ( . . . )  =  =  FALSE  )   {  
        return FALSE;  
    }  
    uAsyncCPIC = RegisterWindowMessage  ("WinAsyncCPIC"");  
    Specify_Windows_Handle  (hwndSample) ;  
    while  (GetMessage  ( . . . )   )   {  
    . . . . .  
    }  
    WinCPICCleanup  ( . . . )  
}  

Per altre informazioni sulle chiamate CPI-C e sulle estensioni di Windows, vedere CpI-C Calls and Extensions for the Windows Environment .For more information about CPI-C calls and Windows extensions, see CPI-C Calls and Extensions for the Windows Environment. Per altre informazioni sull'uso di CPI-C, vedere informazioni di riferimento sulle comunicazioni common programming interface di IBM Systems Application Architecture, numero di parte SC26-4399-04.