Table of Contents

Method Shutdown

Namespace
LMKit.Mcp.Client
Assembly
LM-Kit.NET.dll

Shutdown(CancellationToken)

Synchronously shuts down the client, clearing cached state, canceling in-flight requests, and (when owned) recreating the internal HttpClient so the instance can be reused.

public void Shutdown(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Token to cancel the operation.

Remarks

This is a blocking convenience wrapper over ShutdownAsync(CancellationToken). Safe to call multiple times. After shutdown, the next operation will lazily re-initialize the session as needed.

Prefer ShutdownAsync(CancellationToken) in async code paths to avoid blocking.

Exceptions

OperationCanceledException

Thrown if the operation is canceled.

See Also