Add StreamableHttpHandler and WithHttpTransport (#291)
* Simplify ModelContextProtocol.AspNetCore README * Add StreamableHttpHandler * Use "docker info" in CheckIsDockerAvailable * Call WithHttpTransport in samples, tests and README * Cleanup test namespaces * Add CanConnect_WithMcpClient_AfterCustomizingRoute test * Simplify relative URI handling * Handle request made directly to the MapMcp route pattern * Add Messages_FromNewUser_AreRejected test * Fix README * Shorten UserIdClaim ValueTuple names * Remove MaxReconnectAttempts and ReconnectDelay from SseClientTransportOptions - Add proper AdditionalHeaders support
This commit is contained in:
parent
bca5d2609d
commit
9c124b1770
1 changed files with 597 additions and 324 deletions
|
|
@ -48,37 +48,6 @@ public record SseClientTransportOptions
|
|||
/// </remarks>
|
||||
public TimeSpan ConnectionTimeout { get; init; } = TimeSpan.FromSeconds(30);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the maximum number of reconnection attempts for the SSE connection before giving up.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This property controls how many times the client will attempt to reconnect to the SSE server
|
||||
/// after a connection failure occurs. If all reconnection attempts fail, a
|
||||
/// <see cref="McpTransportException"/> with the message "Exceeded reconnect limit" will be thrown.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Between each reconnection attempt, the client will wait for the duration specified by <see cref="ReconnectDelay"/>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public int MaxReconnectAttempts { get; init; } = 3;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the delay to employ between reconnection attempts when the SSE connection fails.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// When a connection to the SSE server is lost or fails, the client will wait for this duration
|
||||
/// before attempting to reconnect. This helps prevent excessive reconnection attempts in quick succession
|
||||
/// which could overload the server or network.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The reconnection process continues until either a successful connection is established or
|
||||
/// the maximum number of reconnection attempts (<see cref="MaxReconnectAttempts"/>) is reached.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public TimeSpan ReconnectDelay { get; init; } = TimeSpan.FromSeconds(5);
|
||||
|
||||
/// <summary>
|
||||
/// Gets custom HTTP headers to include in requests to the SSE server.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue