start runs the candidate using the provided connection.
(a *Agent, conn net.PacketConn, initializedCh <-chan struct{})
| 233 | |
| 234 | // start runs the candidate using the provided connection. |
| 235 | func (c *candidateBase) start(a *Agent, conn net.PacketConn, initializedCh <-chan struct{}) { |
| 236 | if c.conn != nil { |
| 237 | c.agent().log.Warn("Can't start already started candidateBase") |
| 238 | |
| 239 | return |
| 240 | } |
| 241 | c.currAgent = a |
| 242 | c.conn = conn |
| 243 | c.closeCh = make(chan struct{}) |
| 244 | c.closedCh = make(chan struct{}) |
| 245 | |
| 246 | go c.recvLoop(initializedCh) |
| 247 | } |
| 248 | |
| 249 | var bufferPool = sync.Pool{ // nolint:gochecknoglobals |
| 250 | New: func() any { |