socket_create_pair
socket_create_pair creates two connected and indistinguishable sockets, and stores them in pair. This function is commonly used in IPC (InterProcess Communication).
Parameters
- domain
-
The domain parameter specifies the protocol family to be used by the socket. See socket_create for the full list.
- type
-
The type parameter selects the type of communication to be used by the socket. See socket_create for the full list.
- protocol
-
The protocol parameter sets the specific protocol within the specified domain to be used when communicating on the returned socket. The proper value can be retrieved by name by using getprotobyname. If the desired protocol is TCP, or UDP the corresponding constants SOL_TCP, and SOL_UDP can also be used.
See socket_create for the full list of supported protocols.
- pair
-
Reference to an array in which the two Socket instances will be inserted.
Return Values
Returns true on success or false on failure.
Changelog
Version | Description |
8.0.0 | pair is a reference to an array of Socket instances now; previously, it was a reference to an array of resources. |