Q:

ncat on windows: -e option forwards input but does not forward output

I start ncat (on Windows 10) with 
ncat -vvlp 1234 -e code.exe

and then connect with a second instance of ncat to the first instance
(ncat 127.0.0.1 1234).  
code.exe is a C program written by me that can be controlled over stdin.
Everything I send via the second ncat gets forwarded to the stdin of code.exe. I know this because I can see code.exe create a folder after sending the command to do so. But the output is not send back until code.exe closes itself.  
Why is that — and how can I fix it?

A:

Ok I found a solution to my problem. I disabled buffering of stdout by using
setbuf(stdout, NULL);

at the start of my C program.

