MCPcopy Create free account
hub / github.com/coder/coder / newConnIO

Function newConnIO

enterprise/tailnet/connio.go:43–73  ·  view source on GitHub ↗
(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,
)

Source from the content-addressed store, hash-verified

41}
42
43func 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
75func (c *connIO) recvLoop() {
76 defer func() {

Callers 1

CoordinateMethod · 0.85

Calls 2

recvLoopMethod · 0.95
InfoMethod · 0.45

Tested by

no test coverage detected