MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / inProcessDialer

Function inProcessDialer

pkg/rpcserver/loopback.go:98–108  ·  view source on GitHub ↗
(lis *inProcessListener)

Source from the content-addressed store, hash-verified

96func (inProcessListener) Addr() net.Addr { return inProcessAddr("in-process") }
97
98func inProcessDialer(lis *inProcessListener) func(context.Context, string) (net.Conn, error) {
99 return func(ctx context.Context, addr string) (net.Conn, error) {
100 server, client := net.Pipe()
101 select {
102 case <-ctx.Done():
103 return nil, ctx.Err()
104 case lis.ch <- server:
105 return client, nil
106 }
107 }
108}
109
110// StartLoopback starts the server on a local address and returns a connection to that address.
111// This function does not add the default DialOptions.

Callers 1

StartLoopbackFunction · 0.85

Calls 3

PipeMethod · 0.80
DoneMethod · 0.80
ErrMethod · 0.45

Tested by

no test coverage detected