Pair<Socket, Socket> socketPair()
Usage
This function creates a pair of sockets that can be used for bi-directional communication. The most common use of this is for setting up communications between a process and its Posix::fork()ed child - each process closes one of the sockets after the fork.
sockets = socketPair();
pid = fork();
if (pid == 0) {
// child process
close(sockets.fst);
// do something
} else {
close(sockets.snd);
// do something else
}