OpenSwoole\Coroutine\Http2\Client->goaway(...)

Latest version: pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5

Declaration

<?php OpenSwoole\Coroutine\Http2\Client->goaway(int $errorCode = OpenSwoole\Constant::HTTP2_ERROR_NO_ERROR, string $debugData): bool

Parameters

errorCode

The error code number to send.

debugData

Pass any string data which can be used to debug errors.

Return

Returns true upon success and false on failure in regard to sending.


Description

The GOAWAY frame is used to initiate a connection closure or signal a serious error status.

Read more about goaway frames to understand how they work and when they should be used. In general, you use a goaway frame to signal to the remote host that an error has happened, this error could be a standard HTTP error or a custom response. This feature is usually used for serious error conditions, it tells the remote server to stop accepting new streams while still finishing currently open ones, allowing for a graceful connection shutdown, good for server maintenance situations.


Last updated on September 20, 2022