INNER CODE UNIT · Go

_

docker/compose · relay/main_test.go:98

		_, _ = io.Copy(io.Discard, conn) // read the FIN, never answer, never close
		time.Sleep(5 * time.Second)
	}()
	return upstream
}

// A peer that never closes after receiving our FIN must not pin the forward
// forever: once one direction is done, the surviving one may stream for as
// long as data flows but is reaped when idle past the grace.
func TestForwardReapsIdleHalfOpenPair(t *testing.T) {
	restore := halfCloseIdleTimeout
	halfCloseIdleTimeout = 200 * time.Millisecond
	t.Cleanup(func() { halfCloseIdleTimeout = restore })

	upstream := silentUpstream(t)
	client, server := tcpPair(t)
	t.Cleanup(func() { _ = client.Close() })

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…