gtpc1m77 | Transmission Control Protocol/Internet Protocol |
ISO-C only |
---|
The claw_connect function is not available in the TARGET(TPF) C
library. |
The claw_connect function starts a request to open a logical
link on an active CLAW adapter.
Format
#include <claw.h>
int claw_connect(unsigned int adapter_id,
unsigned int *path_id,
const char *disconn_ep,
const char *msg_ep,
enum s_recv_method recv_method,
void *path_anchor,
const char *hostappl,
const char *wsappl);
- adapter_id
- A 4-byte field that contains the adapter ID for the adapter that was
returned from the claw_openadapter request.
- path_id
- A pointer to a 4-byte field that contains the unique value that will be
filled in by the CLAW workstation to identify this path. This
path_id value must be used on subsequent claw_send and
claw_disconnect requests for this path.
- disconn_ep
- A pointer to a 4-byte field that contains the character string
CLA2. This entry point is called asynchronously if the workstation
starts a disconnect request to the host. This routine is defined as a
TPF real-time program.
- msg_ep
- A pointer to a 4-byte field that contains the character string
CLA4. This user exit, which is a nonsocket message user exit, is called
asynchronously whenever a message is sent on this path from the workstation to
the host if the path is defined with a recv_method of
PAGERECV. This routine is defined as a TPF real-time
program.
- recv_method
- A variable specifies how messages are to be received on this path.
This variable must belong to the enumeration type s_recv_method
defined in claw.h. PAGERECV is the only
recv_method supported.
- PAGERECV
- CLAW calls msg_ep with the address and length of the data just
received. The application does not need to issue a RECEIVE to receive
the data.
- SYNCRECV_FLUSH
- Reserved for future IBM use.
- SYNCRECV_HOLD
- Reserved for future IBM use.
- ASYNCRECV_FLUSH
- Reserved for future IBM use.
- ASYNCRECV_HOLD
- Reserved for future IBM use.
- AUTORECV
- Reserved for future IBM use.
- path_anchor
- A pointer to the address of an anchor word that is unique to this
particular path. This field is filled in by TPF CLAW services upon
successful completion of the claw_connect request. The
caller may use that anchor word for whatever purpose it chooses as long as the
path remains connected. The address of this anchor word is passed by
TPF CLAW system services as an argument in calls to the disconn_ep,
msg_ep, and connect_ep exits.
- hostappl
- A pointer to an 8-byte field that contains the host application name to be
passed to the workstation on the CONNECT request.
- wsappl
- A pointer to an 8-byte field that contains the workstation application
name to be passed to the workstation on the CONNECT request.
Normal Return
Return code 0 indicates that the function was successful.
Error Return
Following is a list of return codes that can be returned to the program
that calls the claw_connect function. See CLAW Return Codes for a complete list of the return codes and their
definitions.
RC_CLAW_INVALID_FUNCTION
RC_CLAW_NOT_INITED
RC_CLAW_ADAPTER_NOT_OPEN
RC_CLAW_ACQUIRE_ERROR
RC_CLAW_CONNECT_ERROR
RC_CLAW_BAD_RECV_METHOD
Programming Considerations
- The claw_connect request is blocked until the workstation
issues an ACCEPT or the logical link is disconnected. An application
that wants to perform a CONNECT asynchronously can create a separate task to
issue the claw_connect function.
- If an application wants to time out a CONNECT request that was not
accepted, it can create an asynchronous task to set a timer and issue a
DISCONNECT request when the timer expires. The CONNECT request ends
with return code RC_CLAW_CONNECT_ERROR. TPF CLAW services fills in the
path_id field immediately, before blocking.
- Activating disconn_ep indicates that a DISCONNECT request is
issued from the workstation to the host. No corresponding DISCONNECT
request to CLAW workstation is required. The application notes that the
path no longer exists. If any SEND or RECEIVE requests are active on
the logical link, they are ended with a return code indicating a nonexistent
path.
- Activating msg_ep, which is a nonsocket message user exit
(CLA4), indicates an incoming CLAW message from the workstation for the paths
using the PAGERECV recv_method. A new ECB is
created and the parameter list is passed to the program starting at
EBW000. See TPF System Installation Support
Reference for additional information about CLA4.
Examples
The following example issues the claw_connect function to open a
logical link.
#include <claw.h>
unsigned int adapter_id;
unsigned int path_id;
char disconn_ep[5] = "CLA2";
char msg_ep[5] = "CLA4";
unsigned int pathanchor;
char host_appl[8] = "TCPIP ";
char ws_appl[8] = "API ";
int claw_rc;
/* Set up adapter_id with the value returned from the
claw_openadapter and pathid functions with the value returned from the
claw_connect function */
·
·
·
claw_rc = claw_connect(adapter_id,&path_id,disconn_ep,
msg_ep,PAGERECV,&pathanchor,
host_appl,ws_appl);
/*normal processing path */
·
·
·
Related Information