MCPcopy Create free account
hub / github.com/devspace-sh/devspace / StartTunnelServer

Function StartTunnelServer

helper/tunnel/server.go:27–53  ·  view source on GitHub ↗
(reader io.Reader, writer io.Writer, exitOnClose, ping bool)

Source from the content-addressed store, hash-verified

25}
26
27func StartTunnelServer(reader io.Reader, writer io.Writer, exitOnClose, ping bool) error {
28 pipe := util.NewStdStreamJoint(reader, writer, exitOnClose)
29 lis := util.NewStdinListener()
30 done := make(chan error)
31
32 go func() {
33 s := grpc.NewServer()
34
35 tunnel := &tunnelServer{
36 ping: &pingtimeout.PingTimeout{},
37 }
38
39 if ping {
40 doneChan := make(chan struct{})
41 defer close(doneChan)
42 tunnel.ping.Start(doneChan)
43 }
44
45 remote.RegisterTunnelServer(s, tunnel)
46 reflection.Register(s)
47
48 done <- s.Serve(lis)
49 }()
50
51 lis.Ready(pipe)
52 return <-done
53}
54
55func SendData(stream remote.Tunnel_InitTunnelServer, sessions <-chan *Session, closeChan chan struct{}) {
56 for {

Callers 1

RunMethod · 0.92

Calls 6

ReadyMethod · 0.95
NewStdStreamJointFunction · 0.92
NewStdinListenerFunction · 0.92
RegisterTunnelServerFunction · 0.92
closeFunction · 0.85
StartMethod · 0.65

Tested by

no test coverage detected