gtpc1m75 | Transmission Control Protocol/Internet Protocol |
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
- If the program is not ready to accept an incoming CONNECT, issue
claw_disconnect instead of claw_accept.
- Activating disconn_ep indicates that a DISCONNECT request is
issued from the workstation to the host. No corresponding DISCONNECT
request to a CLAW workstation is required. If any SEND or RECEIVE
requests are active on the logical link, they end with a return code
indicating a nonexistent path. A new ECB is created and the parameter
list is passed to the program starting at EBW000.
- Activating msg_ep, which is a nonsocket message user exit
(CLA4), indicates an incoming CLAW message from the workstation for the paths
using the recv_method of PAGERECV. 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, including the length
and address of the data.
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