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

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

4.8.6 tprecv - Receive message from interactive service

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

(1) Form

(a) TP1/Client/W
 
#include <dcvxatmi.h>
int tprecv(DCLONG cd, char *CLTFAR *data,
           DCLONG CLTFAR *len,
           DCLONG flags, DCLONG CLTFAR *revent)
 
(b) TP1/Client/P
 
#include <dcvxatmi.h>
int tprecv(DCLONG cd, char CLTFAR *CLTFAR *data, 
      DCLONG CLTFAR *len, DCLONG flags, 
      DCLONG CLTFAR *revent)
 

(2) Purpose

Receives data from the interactive service.

The system without control of connection can issue the tprecv function.

When the tprecv function returns with TPEV_SVCSUCC or TPEV_SVCFAIL specified in revent, the value passed by the application as the tpreturn function argument can be referenced as the global variable tpurcode.

(3) Arguments set by UAPs

(4) Return values

If an error occurs, the tprecv function returns -1 and sets one of the following values in tperrno as a return value to report the information about the error.

Return value Meaning
TPEINVAL Invalid argument
TPEBADDESC Invalid descriptor is specified in cd.
TPEOTYPE The issuer of the tprecv function does not identify the buffer type arrived. Alternatively, the buffer type specified in data does not match the sent buffer type when TPNOCHANGE is specified in the flags argument.
In either case, the value of data or len remains unchanged. When the service is executed as a transaction of the issuer of the tprecv function, the transaction is rolled back until the arrived buffer is aborted.
If the above error occurred, the specified event is aborted and the processing result of the service is undetermined. The issuer must terminate the service immediately.
TPETIME A timeout error occurred.
  • For the issuer in the transaction mode:
    A transaction timeout error occurred. The transaction is rolled back. In this case, TPETIME is returned to new data transmission or undetermined response until the transaction is rolled back.
  • For the issuer in other than the transaction mode:
    A blocking timeout error occurred where neither TPNOBLOCK nor TPNOTIME is specified.
In either case, the value specified in data is not changed.
TPEEVENT An event occurred. The return value is returned to revent.
TPEBLOCK Blocking status occurred when the tprecv function was issued with TPNOBLOCK specified.
TPGOTSIG The signal is received, but TPSIGRSTRT is not specified.
TPEPROTO Inappropriate status for issuing the tpdiscon function.
TPESYSTEM An error occurred in the communication resource manager.
TPEOS An error occurred in the operating system.

(5) Notes