MCP PHP SDK

ReconnectPolicy

FinalYes

How HttpTransport resumes an SSE stream that closed before its response arrived.

A server-provided SSE retry value sets the delay. Without one, the delay starts at the initial delay and doubles after each failed attempt, up to the maximum delay.

Tags
author

Christopher Hertel mail@christopher-hertel.de

Table of Contents

Properties

$initialDelayMs  : int
$maxAttempts  : int
$maxDelayMs  : int

Methods

__construct()  : mixed
delayMs()  : int
Delay before the next attempt after the given number of consecutive failed ones.

Properties

Methods

__construct()

public __construct([int $maxAttempts = 5 ][, int $initialDelayMs = 1000 ][, int $maxDelayMs = 10000 ]) : mixed
Parameters
$maxAttempts : int = 5

Consecutive failed GET attempts before the request fails. Zero disables resumption.

$initialDelayMs : int = 1000

Delay before the first attempt when the server sent no retry field

$maxDelayMs : int = 10000

Cap for the client-selected delay. A server-provided retry value is not capped.

delayMs()

Delay before the next attempt after the given number of consecutive failed ones.

public delayMs(int $failedAttempts[, int|null $serverRetryMs = null ]) : int
Parameters
$failedAttempts : int
$serverRetryMs : int|null = null
Return values
int
On this page

Search results