Forum Navigation
Socket oddities
Moderators:
kris
Posted: 05/09/08 20:07:08I have some code that involves writing to sockets. I was getting no output, so I put in some print statements to make sure the right methods were being called. I wasn't getting any output from those debug Stdouts, so I added a flush() statement for each call to Stdout.
Suddenly I was getting socket output! And also output on stdout. I removed all the Stdout statements and the socket output disappeared.
What's more confusing, I only got socket output if I had one of these Stdout calls _before_ writing to the socket. (And flushing the socket didn't help.)
For now, I have a workaround of preceding my socket writes with Stdout.flush(); but that's ugly. Any ideas what might be going wrong? (I'm on Linux, dmd1.029, tango 0.99.5.)












