in reply to Re^3: cmd timeout
in thread cmd timeout
And it's no exception here. There's no guarantee that enough other packets will be gathered to fill the buffer in that second. Or maybe you're trying to make sure the child finishes, but close already does that by calling a blocking waitpid.