I have 3 stream I want to connect:
- TCP stream from socket (input, output)
- stdin, stdout, stderr
- subprocess stream (p.stdin, p.stderr, p.stdout)
And this is how I want to wire them together:
(p is process, TCP is socket connection)
- TCP.out -> stdin, p.stdin
- p.stdour -> stdout, TCP.in
- p.stderr -> stderr
I've been digging through documentation and googling around, however to no avail. Can you please point me in the right direction how would I do this?
I know I can treat every stream as file descriptor and read/write to it... but it feels ugly and that better solution exists, either already supported or some external library.