gtpc1m7d | Transmission Control Protocol/Internet Protocol |
ISO-C only |
---|
The claw_send function is not available in the TARGET(TPF) C
library. |
The claw_send function sends a message on an active logical
link.
Format
#include <claw.h>
int claw_send(unsigned int adapter_id,
unsigned int path_id,
char *msg_addr,
int msg_len,
enum s_send_method send_method);
- adapter_id
- A 4-byte field that contains the adapter ID for this adapter that was
returned by the claw_openadapter request.
- path_id
- A 4-byte field that contains the path ID assigned to this path at
claw_connect time.
- msg_addr
- A pointer to a data buffer or a list of discontiguous buffers. If
send_method for this message is SEND_LIST, this field
contains the address of the first element in an array of CLAWPAGE
structures. This structure describes the address, length, and
more-to-come bit status of a page frame to be transferred. If
send_method for this message is SEND_NOLIST, this field
contains the address of the message to be sent.
- msg_len
- A 4-byte field that contains the number of bytes in a data buffer or the
number of elements in an array of pointers. If send_method
for this message is SEND_LIST, this field contains the number of
elements in an array of CLAWPAGE structures. If
send_method for this message is SEND_NOLIST, this field
contains the length of the message to be sent up to 4 KB.
- send_method
- A variable specifying how messages are to be sent on this path.
This variable must belong to the enumeration type s_send_method,
defined in the claw.h header file. The following
values may be specified:
- SEND_LIST
- The application passes an array of descriptors to TPF CLAW services, each
containing the address, length, and status of a message or portion of a
message. A message or portion of a message described by one of these
descriptors can be any length but it must not cross a 4 KB boundary (thereby
effectively limiting its length to 4096 bytes).
- SEND_NOLIST
- The application passes the address and length of the message to
CLAW. The message must not cross a 4 KB boundary.
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_send function. See CLAW Return Codes for a complete list of the return codes.
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_SEND_METHOD
Programming Considerations
- The claw_send request is blocked until all requested data has
been transferred. An active claw_send request can be ended
by the claw_disconnect or claw_closeadapter functions,
but some or all of the message may be sent anyway. If
SEND_LIST is used for send_method, a logical message
consists of a series of possible discontiguous blocks, as specified in the
list, until one without the more-to-come bit set on is found. It is
possible to have one logical message span several claw_send
requests. It is also possible to have one claw_send request
include multiple messages.
- The CLAWPAGE structure ICLAWG DSECT is used to communicate
between the CLAW application and CLAW when the send_method is
SEND_LIST. See the ICLAWG DSECT for more information.
Examples
The following example issues the claw_send function to send the
message to the workstation.
#include <claw.h>
unsigned int adapter_id;
unsigned int path_id;
char *msg;
int length;
int claw_rc;
/* Set up adapter_id with the value returned from the claw_openadapter function
and path_id with the value returned from the claw_connect function */
·
·
·
claw_rc = claw_send(adapter_id,path_id,msg,length,SEND_NOLIST);
/*normal processing path */
·
·
·
Related Information