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

Method handleForwardConnection

util/clissh/ssh.go:245–261  ·  view source on GitHub ↗
(conn net.Conn, targetAddr string)

Source from the content-addressed store, hash-verified

243}
244
245func (c *SecureShell) handleForwardConnection(conn net.Conn, targetAddr string) {
246 defer conn.Close()
247
248 target, err := c.secureClient.Dial("tcp", targetAddr)
249 if err != nil {
250 fmt.Printf("connect to %s failed: %s\n", targetAddr, err.Error())
251 return
252 }
253 defer target.Close()
254
255 wg := &sync.WaitGroup{}
256 wg.Add(2)
257
258 go copyAndClose(wg, conn, target)
259 go copyAndClose(wg, target, conn)
260 wg.Wait()
261}
262
263func (c *SecureShell) localForwardAcceptLoop(listener net.Listener, addr string) {
264 defer listener.Close()

Callers 1

Implementers 4

secureShellcf/ssh/ssh.go
FakeSecureShellcf/ssh/sshfakes/fake_secure_shell.go
FakeSecureShellClientactor/sharedaction/sharedactionfakes/f
SecureShellutil/clissh/ssh.go

Calls 7

copyAndCloseFunction · 0.70
CloseMethod · 0.65
DialMethod · 0.65
PrintfMethod · 0.65
ErrorMethod · 0.65
AddMethod · 0.65
WaitMethod · 0.65

Tested by

no test coverage detected