setConn sets the `conn` and returns false if there's already a connection set.
(conn Conn)
| 528 | |
| 529 | // setConn sets the `conn` and returns false if there's already a connection set. |
| 530 | func (u *updater) setConn(conn Conn) bool { |
| 531 | u.mu.Lock() |
| 532 | defer u.mu.Unlock() |
| 533 | |
| 534 | if u.conn != nil { |
| 535 | return false |
| 536 | } |
| 537 | u.conn = conn |
| 538 | return true |
| 539 | } |
| 540 | |
| 541 | func (u *updater) stop() error { |
| 542 | u.mu.Lock() |