MCPcopy Create free account
hub / github.com/astercloud/aster / Stop

Method Stop

pkg/desktop/bridge_electron.go:132–149  ·  view source on GitHub ↗

Stop stops the HTTP/WebSocket server

(ctx context.Context)

Source from the content-addressed store, hash-verified

130
131// Stop stops the HTTP/WebSocket server
132func (b *ElectronBridge) Stop(ctx context.Context) error {
133 if b.cancel != nil {
134 b.cancel()
135 }
136
137 // Close all WebSocket clients
138 b.wsMu.Lock()
139 for _, client := range b.wsClients {
140 close(client.closeCh)
141 }
142 b.wsClients = make(map[string]*wsClient)
143 b.wsMu.Unlock()
144
145 if b.server != nil {
146 return b.server.Shutdown(ctx)
147 }
148 return nil
149}
150
151// RegisterAgent registers an agent with the bridge
152func (b *ElectronBridge) RegisterAgent(ag *agent.Agent) error {

Callers

nothing calls this directly

Calls 2

cancelMethod · 0.45
ShutdownMethod · 0.45

Tested by

no test coverage detected