gtpc1m75Transmission Control Protocol/Internet Protocol

claw_accept -- Accept a CONNECT Request from the Workstation

ISO-C only

The claw_accept function is not available in the TARGET(TPF) C library.

The claw_accept function completes the construction of a logical link that was started by a CONNECT request from the workstation.

Format

#include  <claw.h>
int       claw_accept(unsigned int adapter_id,
                    unsigned int path_id,
                    const char *disconn_ep,
                    const char *msg_ep,
                    enum s_recv_method recv_method);

adapter_id
A 4-byte field that contains the adapter ID for this adapter that was returned from the claw_openadapter function request.

path_id
A 4-byte field that contains the path ID, which indicates the same path over which a connection request was received from a CLAW workstation.

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 ID 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 that was 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.

Normal Return

Return code 0 indicates that the function was successful.

Error Return

Following is a list of return conditions that are returned to programs that call claw_accept. 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_PATH_NOT_THERE

RC_CLAW_BAD_RECV_METHOD

Programming Considerations

Examples

The following example issues the claw_accept function to accept a CONNECT request from the workstation.

     #include  <claw.h>
 
     unsigned int   adapter_id;
     unsigned int   path_id;
     char           disconn_ep[5] = "CLA2";
     char           msg_ep[5] = "CLA4";
     int            claw_rc;
 
/* Set up adapter_id with the value returned from the
claw_openadapter and path_id with the value returned from the
claw_connect */

·
·
·
claw_rc = claw_accept(adapter_id,path_id,disconn_ep,msg_ep,PAGERECV); /*normal processing path */
·
·
·

Related Information