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

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

4.8.3 tpconnect - Establish connection with 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>
DCLONG tpconnect(char *svc, char *data, DCLONG len,
                 DCLONG flags)
(b) TP1/Client/P
 
#include <dcvxatmi.h>
DCLONG tpconnect(char CLTFAR *svc, char CLTFAR *data, 
                 DCLONG len, DCLONG flags)
 

(2) Purpose

Establishes half-duplex connection between TP1/Client and an interactive service. When the function is processed normally, the descriptor that specifies the connection is returned.

The issuer of the tpconnect function can pass the specified information to the service function to the receiver during establishment of connection. To pass information, the pointer to the buffer allocated by the tpalloc function must be specified in data, and the data length to send must be specified in len.

The tpconnect function allows information to be received under the interactive service without issuing the function for receiving data.

(3) Arguments set by UAPs

(4) Return values

When the processing completes successfully, the tpconnect function returns a descriptor to specify the established connection. If an error occurs, the 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
TPENOENT Since the value specified in the argument is not defined in the system, connection cannot be established.
TPEITYPE The value specified in the argument cannot be used in the specified service.
TPELIMIT Since the number of unsolved connections reached to the limit, the request from the caller is not sent.
TPETRAN The specified service belongs to the server unavailable for transaction processing, but TPNOTRAN is not specified.
TPETIME A timeout error occurred.
  • For the issuer in the transaction mode:
    A transaction timeout error occurred. The process terminates abnormally. The transaction is rolled back. TPETIME is returned to any message sent or received by any connection until rollback is completed.
  • For the issuer in other than the transaction mode:
    A blocking timeout error occurred where neither TPNOBLOCK nor TPNOTIME is specified.
TPEBLOCK Blocking status occurred when the tpconnect function was issued with TPNOBLOCK specified.
TPGOTSIG The signal is received, but TPSIGRSTRT is not specified.
TPEPROTO Inappropriate status for issuing the tpconnect function.
TPESYSTEM An error occurred in the communication resource manager.
TPEOS An error occurred in the operating system.

(5) Notes