McpServer.pingClient

Initiate a server->client ping on the GET SSE stream owned by the session sessionId (its Mcp-Session-Id). On a stateful HTTP server every per-session GET stream is registered under its session id as the listener's owner token, so the probe must be scoped to that token to reach the right stream — an empty token (the no-arg pingClient) matches no session-scoped listener and would always fail. The waiter is likewise scoped to sessionId, so only a response POSTed under the same session resolves it. Throws as the no-arg form does, plus when no GET stream is connected for that session.

  1. void pingClient(Duration timeout)
  2. void pingClient(string sessionId, Duration timeout)
    class McpServer
    @safe
    void
    pingClient
    (
    string sessionId
    ,
    Duration timeout = 60.seconds
    )