MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / Disconnect

Method Disconnect

mcp/client.go:147–157  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

145}
146
147func (c *McpClient) Disconnect(ctx context.Context) {
148 c.mu.Lock()
149 c.stopPingLocked()
150 transport := c.transport
151 c.transport = nil
152 c.state = ConnectionDisconnected
153 c.mu.Unlock()
154 if transport != nil {
155 _ = transport.Close(ctx)
156 }
157}
158
159func (c *McpClient) Reconnect(ctx context.Context) bool {
160 c.Disconnect(ctx)

Calls 2

stopPingLockedMethod · 0.95
CloseMethod · 0.65