socket_create_pair
Creates a pair of indistinguishable sockets and stores them in an array
&reftitle.description;
boolsocket_create_pair
intdomain
inttype
intprotocol
arrayfd
socket_create_pair creates two connected and
indistinguishable sockets, and stores them in fd.
This function is commonly used in IPC (InterProcess Communication).
&reftitle.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.
fd
Reference to an array in which the two socket resources will be inserted.
&reftitle.returnvalues;
&return.success;
&reftitle.examples;
socket_create_pair example
]]>
socket_create_pair IPC example
]]>
&reftitle.seealso;
socket_create
socket_create_listen
socket_bind
socket_listen
socket_last_error
socket_strerror