Receiving Data
The following calls or extensions allow a program to receive data from its partner program.
-
Receive (cmrcv)
-
Issuing this call while the conversation is in RECEIVE state causes the local program to receive any data that is currently available from the partner program. If no data is available and the receive type is set to CM_RECEIVE _AND_WAIT, the local program waits for data to arrive. If the receive type is set to CM_RECEIVE_IMMEDIATE, the program does not wait.
Issuing this call while the conversation is in SEND or SEND_PENDING state is allowed only if the receive type is set to CM_RECEIVE_AND_WAIT. This flushes the LU's send buffer and changes the conversation state to RECEIVE. The local program then begins to receive data.
-
Set_Fill (cmsf)
-
Used in a basic conversation, this call sets the conversation's fill type, which specifies whether programs will receive data in the form of logical records or as a specified length of data. This call has an effect only in basic conversations. The fill value affects all subsequent Receive calls. It can be changed by reissuing Set_Fill.
-
Set_Processing_Mode (cmspm)
-
Specifies for the conversation whether subsequent calls will be returned when the operation they have requested is complete (blocking) or immediately after the operation is initiated (nonblocking). A program is notified of the completion of nonblocking calls when it issues Wait_For_Conversation or through a Windows message sent to a WndProc identified by the hwndNotify parameter in Specify_Windows_Handle.
-
Set_Receive_Type (cmsrt)
-
Sets the conversation's receive type, which specifies whether a program issuing a Receive call will wait for data to arrive if data is not available. The receive type value affects all subsequent Receive calls. It can be changed by reissuing Set_Receive_Type.
-
Specify_Windows_Handle (xchwnd)
-
Sets the window handle to which a message is sent on completion of an operation in nonblocking mode. An application can set the processing mode by calling Set_Processing_Mode. If the window handle is set to NULL or this call is never issued, then the application must call Wait_For_Conversation to be notified when the outstanding operation completes.
-
WinCPICSetBlockingHook
-
Allows a Windows CPI-C implementation to block CPI-C function calls by means of a new function. This call must be explicitly issued for Windows version 3.x applications to make blocking calls without blocking the rest of the system.
A Windows CPI-C implementation has a default mechanism by which blocking CPI-C functions are implemented. This function enables the application to execute its own function at blocking time in place of the default function.