I am not sure if this is what you are trying to do:
nc -l -p 8096 -c second &
nc -c first 127.0.0.1 8096 &
This begins by opening a listening socket on port 8096, and once a connection is established, spawns program second with its stdinstdin as the stream output and stdoutstdout as the stream input. This is
Then, a second ncnc is launched which connectconnects to the listening port and spawnspawns program first with its stdoutstdout as the stream input and its stdinstdin as the stream output.
This is not exactly done using a pipe, but it seams doingseems to do what you need.
As this uses the network, this can be done on 2 remote computescomputers. This is almost the wasway a web server (second) and a web browser (first) work.