disconnect 断开连接
(ctx context.Context)
| 165 | |
| 166 | // disconnect 断开连接 |
| 167 | func (i *AGUIInterface) disconnect(ctx context.Context) error { |
| 168 | i.mu.Lock() |
| 169 | defer i.mu.Unlock() |
| 170 | |
| 171 | // TODO: 实现实际的断开逻辑 |
| 172 | // 1. 注销 AsterOS 实例 |
| 173 | // 2. 关闭 WebSocket 连接 |
| 174 | |
| 175 | i.connected = false |
| 176 | |
| 177 | if i.opts.EnableLogging { |
| 178 | fmt.Printf(" [AGUI] Disconnected from Control Plane\n") |
| 179 | } |
| 180 | |
| 181 | return nil |
| 182 | } |
| 183 | |
| 184 | // syncLoop 同步循环 |
| 185 | func (i *AGUIInterface) syncLoop(ctx context.Context) { |