The socket or socketpair callable service creates a socket or a pair of sockets for communication.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task or SRB |
Cross memory mode: | PASN = HASN |
AMODE (BPX1SOC): | 31-bit task or SRB mode |
AMODE (BPX4SOC): | 64-bit task mode only |
ASC mode: | Primary mode |
Interrupt status: | Enabled for interrupts |
Locks: | Unlocked |
Control parameters: | All parameters must be addressable by the caller and in the primary address space. |
|
AMODE 64 callers use BPX4SOC with the same parameters.
The name of a field that contains the address domain requested. See BPXYSOCK — Map SOCKADDR structure and constants for more information about the values that are defined for this field.
The name of a field that contains the protocol requested. See BPXYSOCK — Map SOCKADDR structure and constants for more information about the values that are defined for this field.
The name of a field that contains the number of sockets to be returned. The value of this field determines whether the service performed is socket or socketpair. See BPXYSOCK — Map SOCKADDR structure and constants for more information about the values that are defined for this field.
The name of a doubleword field into which a socket descriptor or pair of socket descriptors is to be stored.
Return_code | Explanation |
---|---|
EACCES | Permission is denied. |
EAFNOSUPPORT | The address family that was specified with the Domain parameter is not supported. |
EAGAIN | The resource is temporarily unavailable. The following reason code can accompany the return code: JRTcpNotActive. |
EINVAL | Dimension is not a valid value. Only 1 or 2 can be specified for this parameter. The following reason code can accompany the return code: JRInvalidParms. |
EIO | There has been a network or transport failure. The following reason code can accompany the return code: JRPFSdead. |
ENOBUFS | A buffer could not be obtained. The following reason code can accompany the return code: JROutofSocketCells. |
EPROTONOSUPPORT | The Protocol parameter is incorrect. It is not 0. The following reason code can accompany the return code: JRSocketProtocolInvalid. |
EPROTOTYPE | The socket type is not supported by the protocol. |
The name of a fullword in which the socket or socketpair service stores the reason code. The socket or socketpair service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.
You can use SOCK#DIM_SOCKETWAFFINITY and SOCK#DIM_SOCKETPAIRWAFFINITY to create a socket or a socket pair with affinity to one specific stack under Common INET. The stack name is passed in the Socket_vector parameter, and this field is overlaid with the output socket descriptor or descriptors when the call is successful. The name is in upper case, left-justified, and padded with blanks. This is the same name that was specified on the SUBFILESYSTYPE NAME() statement that defined this stack in BPXPRMxx.
If Common INET is not installed, the stack name is ignored. If Common INET is installed and the stack name does not match any stack configured under CINET, the call fails with a return code of EIBMBADTCPNAME.
This affinity overrides any process-level stack affinity for this one socket only.
None.
There are no restrictions on the use of socket or socketpair.
For an example using this callable service, see BPX1SOC (socket or socketpair) example.