非同期呼び出し完了
1 つの例外を除き、Microsoft® Host Integration Server では、接続ごとに 1 つの未処理の Windows® SNA 非同期呼び出しと、スレッドごとに 1 つのブロック動詞が許可されます。 これに対する例外は、非同期 の受信 呼び出しを発行するときに、 受信 が未処理の間に次の呼び出しを発行できることです。
-
これにより、アプリケーション (特に 5250 エミュレーター) が非同期 の Receive を使用してデータを受信できるようになります。 この機能を使用することを強くお勧めします。
次の例は、Host Integration Server で非同期呼び出し補完を使用する方法を示しています。
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 ( . . . )
}
CPI-C 呼び出しと Windows 拡張機能の詳細については、「WINDOWS 環境のCPI-C 呼び出しと拡張機能」を参照してください。 CPI-C の使用の詳細については、「 IBM Systems Application Architecture Common Programming Interface Communications Reference, part number SC26-4399-04」を参照してください。