#include <qtoqsapi.h> int qtoq_connect( int socket_descriptor, struct sockaddr *address, int address_length, int req_type, qos_conn_req *qos_data, unsigned int *qos_session, int *qos_descriptor, )Service Program Name: QSYS/QTOQSAPI
The qtoq_connect() API provides simplified Quality of Service functionality for connection-oriented sockets communications between RSVP aware applications on a client and server. The standard connect() sockets call can be replaced with this API.
An opened socket descriptor that has been bound to the IP address and port from which the application will accept connection requests.
A pointer to a sockaddr structure containing the IP address and port of the server to connect to.
Integer containing the length of the destination address structure.
The type of QoS service being requested. The possible values are:
REQ_SIGNAL_RET_EVENTS(1) | Use normal RSVP signaling and return RSVP events to the calling program. |
REQ_SIGNAL_NORET_EVENTS(2) | Use normal RSVP signaling without returning events to the calling program. |
Pointer to a qos_conn_req data structure that defines the type of service being requested and the source and destination addresses of the request.
The qos_conn_req data structure is defined below:
typedef struct { int service; ; /* Values can be GUARANTEED_SERV (2) or CONTROLLED_LOAD_SERV (5) */ union { struct CL_spec /* Controlled-Load service */ { float TB_Tspec_r; /* token bucket rate in bytes/sec */ float TB_Tspec_b; /* token bucket depth in bytes */ float TB_Tspec_p; /* token bucket peak in bytes/sec */ unsigned long TB_Tspec_m; /* min policed unit in bytes */ unsigned long TB_Tspec_M; /* max packet size in bytes */ } CL_spec; struct Guar_spec /* Guaranteed service */ { float Guar_R; /* guaranteed rate in bytes/sec */ unsigned long Guar_S; /* slack term in microsecs */ } Guar_spec; } spec_u; } qos_spec_t; typedef struct { struct sockaddr source; /* Source address/port */ int s_length; /* Source address length */ int style; /* Style of Reservation. */ qos_spec_t Spec; /* Flow info */ unsigned char result; /* API status */ } qos_conn_req; /* End of QoS connection request structure */
Pointer to an integer value where the unique QoS session ID can be stored. This ID is required for all future QoS API calls.
Pointer to an integer where the value of the descriptor that the application can wait on for RSVP events is stored. This value is set to NULL if it is not used.
None.
0 | if successful. |
-1 | if function failed. Errno indicates error reason. |
When this function call fails, the errno value is set to one of the following:
Permission denied. This error code indicates one of the following:
Address already in use. This error code indicates one of the following:
Address not available. This error code indicates one of the following:
The type of socket is not supported in this protocol family. The address family specified in the address structure pointed to by the destination_address parameter cannot be used with the socket pointed to by the socket_descriptor parameter. This error also will be reported if the API is called with a socket type that is not AF_INET and SOCK_DGRAM or SOCK_STREAM.
Operation already in progress. A previous connect() function had already been issued for the socket pointed to by the socket_descriptor parameter, and has yet to be completed. This error code is returned only on sockets that use a connection-oriented transport service.
Descriptor not valid.
The destination socket refused an attempted connect operation. This error occurs when there is no application that is bound to the address specified by the destination_address parameter.
Bad address. The system detected an address that was not valid while attempting to access the destination_address parameter.
A route to the remote host is not available.
Operation in progress. The socket_descriptor parameter points to a socket that is marked as non blocking and the connection could not be completed immediately. This error code is returned only on sockets that use a connection-oriented transport service.
Interrupted function call.
Parameter not valid. This error code indicates one of the following:
Input/output error.
A connection has already been established. This error code is returned only on sockets that use a connection-oriented transport service.
Cannot reach the destination network. This error code indicates the following:
There is not enough buffer space for the requested operation.
Not a directory.
Operation not supported.
A remote host did not respond within the timeout period. This error code is returned when connection establishment times out. No connection is established. A possible cause may be that the partner application is bound to the address specified by the destination_address parameter, but the partner application has not yet issued a listen().
Unknown system state.
The protocol required to support the specified address family is not available at this time.
An underlying protocol error has occurred.
Message ID | Error Message Text |
---|---|
CPE3418 E | Possible APAR condition or hardware failure. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
CPFA081 E | Unable to set return value or error code. |
For a description of the RSVP protocol, see RFC 2205 on the RFC Pages for The Internet Engineering Task Force.
Top | UNIX-Type APIs | APIs by category |