MSendRcv: Multi-threaded APPC Calls with Event Completion

Click to open or copy the files for the MSendRcv sample.

This sample demonstrates multi-threaded APPC calls with event completion.  It includes the following three files.

Mrcv.c - RECEIVE using event completion

This file contains the routines for a multi-threaded routine which uses asynchronous APPC calls with event completion to receive data. It runs with either the single-threaded or the multi-threaded version of send (msend or sendtp). This is a Windows NT application which runs in a minimized window.

This program is compatible with the single-threaded versions of send, which can be run, for example, on WIN16 clients.

Msend.c - SEND using event completion

This file contains the routines for a multi-threaded routine which uses asynchronous APPC calls with event completion to send data. It runs with either the single-threaded or the multi-threaded version of receive (mrcv or recvtp).

This program is compatible with the single-threaded version of receive, which can be run, for example, on WIN16 clients.

Msendrcv.c - SEND and RECEIVE using event completion

This file contains the routines for a multi-threaded routine which uses asynchronous APPC calls with event completion to send and receive data. It requires another copy of itself on another machine to run or it can send and receive to itself.

Each conversation issues MC_RECEIVE_AND_WAIT verbs to receive data. If confirmation is requested, an MC_CONFIRM verb is issued.

This program is compatible with the single-threaded versions of send and receive, which can be run, for example, on WIN16 clients.

For more information, see Multithreaded APINGD in Microsoft SNA Server.

There is a Snaenv.bat file to set environment variables, available via the SNA Samples topic.

Building SDK Samples

This sample uses the following keywords:

acssvc_c; appc_flipi; appc_flipl; atoi; build_mc_allocate; build_mc_confirm; build_mc_confirmed; build_mc_deallocate; build_mc_receive_and_wait; build_mc_send_conversation; build_mc_send_data; build_receive_allocate; build_tp_ended; build_tp_started; closehandle; conv_a_to_e; conv_e_to_a; createevent; createthread; createwindow; debugbreak; defwindowproc; deletecriticalsection; dispatchmessage; endconversation; entercriticalsection; fclose; fflush; fopen; fprintf; generatedata; getc; getlasterror; getlocaltime; getmessage; getmodulefilename; getstockobject; getthreadpriority; gettickcount; initializecriticalsection; initializemain; initializewinmain; issuercvverb; issuesendverb; leavecriticalsection; loadcursor; loadicon; lstrcpy; malloc; memchr; memcpy; memset; outputresults; padstring; postmessage; postquitmessage; processreturns; rcvallocthread; readconfig; readstring; receivethread; registerclass; sendthread; setthreadpriority; setwindowtext; showwindow; sprintf; srtrace; srtrclose; srtrflush; srtropen; startconversation; strcmpi; strcpy; strncpy; strtok; strupr; tpwndproc; translatemessage; waitformultipleobjects; waitforsingleobject; winappccleanup; winappcstartup; winasyncappcex; winmain