MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / echoTCP

Function echoTCP

orchestration/orchestrator_test.go:539–547  ·  view source on GitHub ↗

nolint: testifylint // this is used inside go routines so it can't use `require.`

(t *testing.T, conn net.Conn)

Source from the content-addressed store, hash-verified

537
538// nolint: testifylint // this is used inside go routines so it can't use `require.`
539func echoTCP(t *testing.T, conn net.Conn) {
540 readBuf := make([]byte, 1000)
541 readN, err := conn.Read(readBuf)
542 assert.NoError(t, err)
543
544 writeN, err := conn.Write(readBuf[:readN])
545 assert.NoError(t, err)
546 assert.Equal(t, readN, writeN)
547}
548
549type validateHostHandler struct {
550 expectedHost string

Callers 2

serveTCPOriginFunction · 0.85
TestPersistentConnectionFunction · 0.85

Calls 3

WriteMethod · 0.65
EqualMethod · 0.65
ReadMethod · 0.45

Tested by

no test coverage detected