B0b Posted May 6, 2010 Share Posted May 6, 2010 Hi everyone! I'm getting an errno 32 broken pipe error when writing to a socket. What I tried to do to avoid the error is to loop fwrite as long as it shows up as false. The problem is that it will indefinitely loop on this condition (ie. it can't get to write these 6 bytes). I don't get why it can't eventually end up successfully writting it? What am I missing? Some sort of buffer that needs to be flushed? $written = false; while ( $written == false ) { // This loop is to avoid the broken pipe error: "send of 6 bytes failed with errno=32 Broken pipe in".*/ $written = fwrite( $this->sock, $msg . "\r\n" ); } Thanks! Link to comment https://forums.phpfreaks.com/topic/200948-send-of-6-bytes-failed-with-errno32-broken-pipe-in/ Share on other sites More sharing options...
B0b Posted May 7, 2010 Author Share Posted May 7, 2010 You guys got to like Errno's pipe as much as me. Link to comment https://forums.phpfreaks.com/topic/200948-send-of-6-bytes-failed-with-errno32-broken-pipe-in/#findComment-1054612 Share on other sites More sharing options...
B0b Posted May 8, 2010 Author Share Posted May 8, 2010 This topic quickly gets to the second page :-\ Link to comment https://forums.phpfreaks.com/topic/200948-send-of-6-bytes-failed-with-errno32-broken-pipe-in/#findComment-1054904 Share on other sites More sharing options...
B0b Posted May 9, 2010 Author Share Posted May 9, 2010 The lastest message in fwrite() PHP documentation talks about my exact issue: http://www.php.net/manual/fr/function.fwrite.php#96951 The guy suggest to either re-attempt a limited number of time (which doesn't seem to be able to get through) or just abort it. The issue is that I can't abort it, I got to write these bytes. How may that broken pipe get fixed? I'm trying few things, but waiting several hours for the problem to arise to see if it's successful or not quickly gets boring. Any suggestion to get it right the first time is highly welcome. Link to comment https://forums.phpfreaks.com/topic/200948-send-of-6-bytes-failed-with-errno32-broken-pipe-in/#findComment-1055232 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.