(ctx context.Context)
| 378 | } |
| 379 | |
| 380 | func (m *agentConnectionMonitor) start(ctx context.Context) { |
| 381 | ctx, m.cancel = context.WithCancel(ctx) |
| 382 | m.wg.Add(2) |
| 383 | go func(ctx context.Context) { |
| 384 | defer m.wg.Done() |
| 385 | m.sendPings(ctx) |
| 386 | }(ctx) |
| 387 | go func(ctx context.Context) { |
| 388 | defer m.wg.Done() |
| 389 | m.monitor(ctx) |
| 390 | }(ctx) |
| 391 | } |
| 392 | |
| 393 | func (m *agentConnectionMonitor) monitor(ctx context.Context) { |
| 394 | reason := "disconnect" |