create a pair of connected sockets
#include <sys/types.h> #include <sys/socket.h> int socketpair( int d, int type, int protocol, int *sv );
The socketpair() call creates an unnamed pair of connected sockets in the specified domain d, of the specified type, using the optionally specified protocol. The descriptors used in referencing the new sockets are returned in sv[0] and sv[1]. The two sockets are indistinguishable.
If an error occurred, errno could contain one of the following:
UNIX
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |