(coordContext context.Context, peerCtx context.Context, logger slog.Logger, bindings chan<- binding, tunnels chan<- tunnel, rfhs chan<- readyForHandshake, requests <-chan *proto.CoordinateRequest, responses chan<- *proto.CoordinateResponse, id uuid.UUID, name string, auth agpl.CoordinateeAuth, )
| 41 | } |
| 42 | |
| 43 | func newConnIO(coordContext context.Context, |
| 44 | peerCtx context.Context, |
| 45 | logger slog.Logger, |
| 46 | bindings chan<- binding, |
| 47 | tunnels chan<- tunnel, |
| 48 | rfhs chan<- readyForHandshake, |
| 49 | requests <-chan *proto.CoordinateRequest, |
| 50 | responses chan<- *proto.CoordinateResponse, |
| 51 | id uuid.UUID, |
| 52 | name string, |
| 53 | auth agpl.CoordinateeAuth, |
| 54 | ) *connIO { |
| 55 | peerCtx, cancel := context.WithCancel(peerCtx) |
| 56 | c := &connIO{ |
| 57 | id: id, |
| 58 | coordCtx: coordContext, |
| 59 | peerCtx: peerCtx, |
| 60 | cancel: cancel, |
| 61 | logger: logger.With(slog.F("name", name), slog.F("peer_id", id)), |
| 62 | requests: requests, |
| 63 | responses: responses, |
| 64 | bindings: bindings, |
| 65 | tunnels: tunnels, |
| 66 | rfhs: rfhs, |
| 67 | auth: auth, |
| 68 | name: name, |
| 69 | } |
| 70 | go c.recvLoop() |
| 71 | c.logger.Info(coordContext, "serving connection") |
| 72 | return c |
| 73 | } |
| 74 | |
| 75 | func (c *connIO) recvLoop() { |
| 76 | defer func() { |
no test coverage detected