MCPcopy Index your code
hub / github.com/coder/coder / ServeConnV2

Method ServeConnV2

tailnet/service.go:125–136  ·  view source on GitHub ↗
(ctx context.Context, conn net.Conn, streamID StreamID)

Source from the content-addressed store, hash-verified

123}
124
125func (s ClientService) ServeConnV2(ctx context.Context, conn net.Conn, streamID StreamID) error {
126 config := yamux.DefaultConfig()
127 config.LogOutput = io.Discard
128 session, err := yamux.Server(conn, config)
129 if err != nil {
130 return xerrors.Errorf("yamux init failed: %w", err)
131 }
132 ctx = WithStreamID(ctx, streamID)
133 s.Logger.Debug(ctx, "serving dRPC tailnet v2 API session",
134 slog.F("peer_id", streamID.ID.String()))
135 return s.drpc.Serve(ctx, session)
136}
137
138// DRPCService is the dRPC-based, version 2.x of the tailnet API and implements proto.DRPCClientServer
139type DRPCService struct {

Callers 9

ServeClientMethod · 0.95
RouterMethod · 0.95
ServeMultiAgentClientMethod · 0.95
DialMethod · 0.80

Calls 5

WithStreamIDFunction · 0.85
ServerMethod · 0.45
ErrorfMethod · 0.45
StringMethod · 0.45
ServeMethod · 0.45