OpenTP1 Version 7 Programming Reference C Language

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

dc_rpc_cltsend - Report data to CUP unidirectionally

Format

ANSI C, C++

#include <dcrpc.h>
int  dc_rpc_cltsend (char *hostname, unsigned short port,
                     char *msg,  DCLONG len, DCLONG flags)

K&R C

#include <dcrpc.h>
int  dc_rpc_cltsend (hostname, port, msg, len, flags)
char       *hostname;
unsigned  short  port;
char       *msg;
DCLONG     len;
DCLONG     flags;

Description

The function dc_rpc_cltsend() sends data to the CUP unidirectionally. This function sends data specified for msg of the length specified for len to the process (CUP) corresponding to the port number of the host specified for hostname and port. The possible sending data length is in the range of bytes from 0 to DCRPC_MAX_MESSAGE_SIZE#.

#: If you used the rpc_max_message_size operand, the value of this data area is the value specified in the rpc_max_message_size operand and not the value of DCRPC_MAX_MESSAGE_SIZE (1 megabyte).

Data sent by the function dc_rpc_cltsend() is received by the TP1/Client library function dc_clt_chained_accept_notification() or dc_clt_accept_notification(). For the function dc_clt_chained_accept_notification() or dc_clt_accept_notification(), see the manual OpenTP1 TP1/Client/W, TP1/Client/P.

Arguments whose values are set in the UAP

hostname

Specify the name of the host to which data is sent. You can specify a character string containing between 1 and 255 characters as the host name. End the character string with a null character.

port

Specify the number of the port to which data is sent.

msg

Specify data to be sent.

len

Specify the length of data to be sent.

flags

Specify DCNOFLAGS.

Return values

Return value Return value (numeric) Explanation
DC_OK 0 Normal termination.
DCRPCER_INVALID_ARGS -301 The value specified for the argument is invalid.
DCRPCER_NET_DOWN -306 A network error occurred.
DCRPCER_PROTO -302 The function dc_rpc_open() was not called.
DCRPCER_NO_BUFS -304 The memory became insufficient.
DCRPCER_MESSAGE_TOO_BIG -308 The length of data to be sent exceeds DCRPC_MAX_MESSAGE_SIZE#.
DCRPCER_SERVICE_NOT_UP -314 There is no process at the destination.
A network error occurred.

#: If you used the rpc_max_message_size operand, the value of this data area is the value specified in the rpc_max_message_size operand and not the value of DCRPC_MAX_MESSAGE_SIZE (1 megabyte).

Notes

  1. Use the function dc_rpc_cltsend() only when the process of the destination calls the TP1/Client function dc_clt_chained_accept_notification() or dc_clt_accept_notification() obviously. If the process of the destination is not active, the function dc_rpc_cltsend() returns with an error, giving the return value DCRPCER_SERVICE_NOT_UP.
  2. Normal return of the function dc_rpc_cltsend() indicates that sending at RPC communication protocol (TCP/IP) level is completed. Therefore, normal termination of the function dc_rpc_cltsend() does not guarantee that the data is received normally by the CUP using the function dc_clt_chained_accept_notification() or dc_clt_accept_notification().
  3. The function dc_rpc_cltsend() can report data only to the function dc_clt_chained_accept_notification() or dc_clt_accept_notification() used by the CUP. Data cannot be sent to SPP processes and local processes.