waitForExits will wait for all socket watcher Go routines to be shutdown before proceeding.
()
| 2444 | // waitForExits will wait for all socket watcher Go routines to |
| 2445 | // be shutdown before proceeding. |
| 2446 | func (nc *Conn) waitForExits() { |
| 2447 | // Kick old flusher forcefully. |
| 2448 | select { |
| 2449 | case nc.fch <- struct{}{}: |
| 2450 | default: |
| 2451 | } |
| 2452 | |
| 2453 | // Wait for any previous go routines. |
| 2454 | nc.wg.Wait() |
| 2455 | } |
| 2456 | |
| 2457 | // ForceReconnect forces a reconnect attempt to the server. |
| 2458 | // This is a non-blocking call and will start the reconnect |