한 가지 예외를 제외하고 Microsoft® Host Integration Server는 연결당 하나의 미해결 Windows® SNA 비동기 호출과 스레드당 하나의 차단 동사를 허용합니다. 단, 비동기 수신 호출을 실행할 때 Receive 가 미해결 상태인 동안 다음 호출을 실행할 수 있습니다.
-
이렇게 하면 애플리케이션, 특히 5250 에뮬레이터가 비동기 수신 을 사용하여 데이터를 받을 수 있습니다. 이 기능을 사용하는 것이 좋습니다.
다음 예제에서는 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 애플리케이션 아키텍처 공통 프로그래밍 인터페이스 통신 참조, 부분 번호 SC26-4399-04를 참조하세요.