MCPcopy
hub / github.com/gliderlabs/ssh / sampleSocketServer

Function sampleSocketServer

tcpip_test.go:16–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14var sampleServerResponse = []byte("Hello world")
15
16func sampleSocketServer() net.Listener {
17 l := newLocalListener()
18
19 go func() {
20 conn, err := l.Accept()
21 if err != nil {
22 return
23 }
24 conn.Write(sampleServerResponse)
25 conn.Close()
26 }()
27
28 return l
29}
30
31func newTestSessionWithForwarding(t *testing.T, forwardingEnabled bool) (net.Listener, *gossh.Client, func()) {
32 l := sampleSocketServer()

Callers 1

Calls 3

newLocalListenerFunction · 0.85
WriteMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…