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

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

4.6.4 dc_clt_assem_send_s - Sending assembled messages

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

(1) Form

(a) _s version of the function
 
#include <dcvclt.h>
DCLONG dc_clt_assem_send_s(DCCLT_ID cltid, char CLTFAR *buff, DCLONG sendleng,
char CLTFAR *hostname, unsigned short portnum, DCLONG timeout, DCLONG flags)
 
(b) Non-_s version of the function
 
#include <dcvclt.h>
DCLONG dc_clt_assem_send(char CLTFAR *buff, DCLONG sendleng, char CLTFAR *hostname,
unsigned short portnum, DCLONG timeout, DCLONG flags)
 

(2) Purpose

The dc_clt_assem_send_s function uses the message assembly facility to send messages. When this facility is used, the function sends four-byte message information followed by the message body specified in the buff argument. If a connection to the remote system has not been established, the function first establishes the connection according to the values specified in the hostname and portnum arguments.

If Y is specified for DCCLTDELIVERYCHECK of the client environment definition, the function also uses the message delivery confirmation facility. In this case, the size of the message information sent before the message body is 11 bytes. After receiving the 11-byte message information, TP1/Client returns control to the CUP.

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

(3) Arguments set by UAPs

(4) 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_SND 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 A connection establishment request timed out. Alternatively, reception of response-only data timed out when the message delivery confirmation facility was being used. 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_WRONG_HOST -2539 The host name is incorrect. Alternatively, a host name is not specified in either hostname or DCSNDHOST.
DCCLTER_CONNREFUSED -2541 A connection establishment request to the remote system was rejected.
DCCLTER_CONNFREE -2542 The connection was released by the remote system when the message delivery confirmation facility was being used.
DCCLTER_INVALID_CLTID -2544 The client ID specified for cltid differs from the one received by the dc_clt_cltin_s function.
DCCLTER_PORT_IN_USE -2547 Port numbers that can be assigned automatically by the operating system are insufficient.
DCCLTER_INVALID_MESSAGE -2548 An invalid message was received when the message delivery confirmation facility was being used. The connection is released.
DCCLTER_COLLISION_MESSAGE -2584 Messages collided when the message delivery confirmation facility was being used. The connection is released.

(5) Notes