MCPcopy
hub / github.com/cloudfoundry/cli / localForwardAcceptLoop

Method localForwardAcceptLoop

cf/ssh/ssh.go:164–179  ·  view source on GitHub ↗
(listener net.Listener, addr string)

Source from the content-addressed store, hash-verified

162}
163
164func (c *secureShell) localForwardAcceptLoop(listener net.Listener, addr string) {
165 defer listener.Close()
166
167 for {
168 conn, err := listener.Accept()
169 if err != nil {
170 if netErr, ok := err.(net.Error); ok && netErr.Temporary() {
171 time.Sleep(100 * time.Millisecond)
172 continue
173 }
174 return
175 }
176
177 go c.handleForwardConnection(conn, addr)
178 }
179}
180
181func (c *secureShell) handleForwardConnection(conn net.Conn, targetAddr string) {
182 defer conn.Close()

Callers 1

LocalPortForwardMethod · 0.95

Calls 2

CloseMethod · 0.65

Tested by

no test coverage detected