OpenTP1 Version 7 TP1/Client User's Guide TP1/Client/W, TP1/Client/P

[Contents][Index][Back][Next]

4.6.5 dc_clt_assem_receive_s - Receiving assembled messages

Organization of this subsection
(1) Form
(2) Purpose
(3) Arguments set by UAPs
(4) Arguments that contain return values
(5) Return values
(6) Notes

(1) Form

(a) _s version of the function
 
#include <dcvclt.h>
DCLONG dc_clt_assem_receive_s(DCCLT_ID cltid, char CLTFAR *buff, DCLONG CLTFAR *recvleng, 
DCLONG timeout, DCLONG flags)
 
(b) Non-_s version of the function
 
#include <dcvclt.h>
DCLONG dc_clt_assem_receive(char CLTFAR *buff, DCLONG CLTFAR *recvleng,
DCLONG timeout, DCLONG flags)
 

(2) Purpose

The dc_clt_assem_receive_s function uses the message assembly facility to receive messages. When this facility is used, the function receives four-byte message information, and then receives data equivalent to the size set in the message information. The function then stores the data in the buff argument. The four-byte message information is not stored in the buff argument. The length of the received message is stored in the recvleng argument. The message length stored in the recvleng argument does not include the message information length.

If Y is specified for DCCLTDELIVERYCHECK of the client environment definition, the message delivery confirmation facility is used when a message is sent or received. In this case, the function receives 11-byte message information, and then receives data equivalent to the size set in the message information. The function then stores the data in the buff argument. The 11-byte message information is not stored in the buff argument. The length of the received message is stored in the recvleng argument. The message length stored in the recvleng argument does not include the message information length. If the received message information includes a response request, the function sends 11-byte message information, and then returns control to the CUP.

Before issuing this function, make sure that you issue the dc_rpc_open_s function in which DCCLT_ONEWAY_RCV or DCCLT_SNDRCV is specified for the flags argument.

(3) Arguments set by UAPs

(4) Arguments that contain return values

(5) Return values

Return value Value (decimal) Meaning
DC_OK 0 Normal termination
DCCLTER_INVALID_ARGS -2501 Invalid argument
DCCLTER_PROTO -2502 Possible causes are as follows:
  • The dc_rpc_open_s function has not been issued.
  • The dc_rpc_open_s function was issued but neither DCCLT_ONEWAY_RCV nor DCCLT_SNDRCV was specified for the flags argument.
DCCLTER_NO_BUFS -2504 Insufficient memory
DCCLTER_NET_DOWN -2506 A network error occurred. The connection is released.
DCCLTER_TIMED_OUT -2507 Message reception timed out. The connection is released.
DCCLTER_SYSERR -2518 A system error occurred. If the error is a network error, the connection is released.
DCCLTER_RESOURCE -2538 Insufficient resource
DCCLTER_CONNFREE -2542 The connection was released by the remote system.
DCCLTER_INVALID_CLTID -2544 The client ID specified for cltid differs from the one received by the dc_clt_cltin_s function.
DCCLTER_INF_TOO_BIG -2546 The area prepared by the CUP was too small to receive the message from the remote system. The connection is released.
DCCLTER_INVALID_MESSAGE -2548 An invalid message was received. The connection is released.

(6) Notes