Open ajschwieterman opened 3 years ago
Maybe related to #79?
Today I encountered the same problem. Here's the minimum example of it:
$ iproxy 8081:8081
Creating listening port 8081 for device port 8081
waiting for connection
# CTRL+C, this is okay
$ iproxy 8081:8081 1> test.txt 2>&1
# CTRL+C, let's see what was written
$ cat test.txt
# the file is empty - not expected
I was very annoyed by this, but a friend helped me and together we figured out how to make it work (kudos to this SO question):
$ stdbuf -i0 -o0 -e0 iproxy 8081:8081 1> test.txt 2>&1
# CTRL+C
$ cat test.txt
Creating listening port 8081 for device port 8081
waiting for connection
It'd be great if you added some fflush()
here and there in iproxy
:)
I'm trying to get the output of an iproxy command using the following code.
When executing the command in the terminal I can see the following response in the terminal.
However, when using the above code, the
data
event isn't triggered in the child process. Maybe I'm not using the correct event handler; I'm not sure what's happening.