Thank you for the quick reply.
1. I added fflush($handle); after the fwrite($handle, "abc\r\n); but unfortunately it does not help.
2. There is no strace as I run on windows (PHP 5.6.4 (cli) (built: Dec 17 2014 13:21:16)). - Yeah, I understand this is linux forum.
Still, this should work the same, should not?