gtpc1m76Transmission Control Protocol/Internet Protocol

claw_closeadapter -- Terminate CLAW Activity on Subchannel Pair

ISO-C only

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

The claw_closeadapter function ends all CLAW activity on a given subchannel pair.

Format

#include  <claw.h>
int       claw_closeadapter(unsigned int adapter_id);

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

Normal Return

Return code 0 indicates that the function was successful.

Error Return

Following is a list of return conditions that can be returned to the program that calls the claw_closeadapter 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_INIT_ERROR

RC_CLAW_CLOSEDEVICE_ERROR

Programming Considerations

All logical links are broken and the CLAW device no longer monitors the subchannel addresses for activity when the claw_closeadapter function is issued. If there are any active logical links open on the subchannel pair, all active SEND and RECEIVE requests end with an error return code and the logical links are disconnected. The appropriate disconn_ep, CLA2, is called for each logical link.

Examples

The following example issues the claw_closeadapter function to close the adapter.

     #include  <claw.h>
 
     unsigned int        adapter_id;
     int                 claw_rc;
 
/* Set up adapter_id with the value returned from the
claw_openadapter function */
     .
     claw_rc = claw_closeadapter(adapter_id);
          /*normal processing path */

·
·
·

Related Information