AddDevGofer initializes the dev gofer connection and starts tracking it. It takes ownership of goferFD.
(contName string, goferFD int)
| 2313 | // AddDevGofer initializes the dev gofer connection and starts tracking it. |
| 2314 | // It takes ownership of goferFD. |
| 2315 | func (k *Kernel) AddDevGofer(contName string, goferFD int) error { |
| 2316 | client, err := devutil.NewGoferClient(k.SupervisorContext(), contName, goferFD) |
| 2317 | if err != nil { |
| 2318 | return err |
| 2319 | } |
| 2320 | |
| 2321 | k.devGofersMu.Lock() |
| 2322 | defer k.devGofersMu.Unlock() |
| 2323 | if k.devGofers == nil { |
| 2324 | k.devGofers = make(map[string]*devutil.GoferClient) |
| 2325 | } |
| 2326 | k.devGofers[contName] = client |
| 2327 | return nil |
| 2328 | } |
| 2329 | |
| 2330 | // RemoveDevGofer closes the dev gofer connection, if one exists, and stops |
| 2331 | // tracking it. |
no test coverage detected