protected function writeBody($socket, RequestInterface $request, int $bufferSize = 8192)
    {
        $body = $request->getBody();

        if ($body->isSeekable()) {
            $body->rewind();
        }

        while (!$body->eof()) {
            $buffer = $body->read($bufferSize);

            if (false === $this->fwrite($socket, $buffer)) {
                throw new BrokenPipeException('An error occur when writing request to client (BROKEN EPIPE)', $request);
            }
        }
    }
protected function writeBody($socket, RequestInterface $request, int $bufferSize = 8192)
    {
        $body = $request->getBody();

        if ($body->isSeekable()) {
            $body->rewind();
        }

        while (!$body->eof()) {
            $buffer = $body->read($bufferSize);

            if (false === $this->fwrite($socket, $buffer)) {
                throw new BrokenPipeException('An error occur when writing request to client (BROKEN EPIPE)', $request);
            }
        }
    }
protected function writeBody ( $ socket , RequestInterface $ request , int $ bufferSize = 8192 ) { $ body = $ request -> getBody ( ) ; if ( $ body -> isSeekable ( ) ) { $ body -> rewind ( ) ; } while ( ! $ body -> eof ( ) ) { $ buffer = $ body -> read ( $ bufferSize ) ; if ( false === $ this -> fwrite ( $ socket , $ buffer ) ) { throw new BrokenPipeException ( 'An error occur when writing request to client (BROKEN EPIPE)' , $ request ) ; } } }
Write Body of the request.

@param resource $socket

@throws BrokenPipeException
Write Body of the request .