detach server i from the net.
(i int)
| 326 | |
| 327 | // detach server i from the net. |
| 328 | func (cfg *config) disconnect(i int) { |
| 329 | // fmt.Printf("disconnect(%d)\n", i) |
| 330 | |
| 331 | cfg.connected[i] = false |
| 332 | |
| 333 | // outgoing ClientEnds |
| 334 | for j := 0; j < cfg.n; j++ { |
| 335 | if cfg.endnames[i] != nil { |
| 336 | endname := cfg.endnames[i][j] |
| 337 | cfg.net.Enable(endname, false) |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | // incoming ClientEnds |
| 342 | for j := 0; j < cfg.n; j++ { |
| 343 | if cfg.endnames[j] != nil { |
| 344 | endname := cfg.endnames[j][i] |
| 345 | cfg.net.Enable(endname, false) |
| 346 | } |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | func (cfg *config) rpcCount(server int) int { |
| 351 | return cfg.net.GetCount(server) |