Jump to content

send of 6 bytes failed with errno=32 Broken pipe in...


B0b

Recommended Posts

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!

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.