MCPcopy Create free account
hub / github.com/pion/ice / TestActiveTCPConn_WriteLoop_WriteStreamingError

Function TestActiveTCPConn_WriteLoop_WriteStreamingError

active_tcp_test.go:364–389  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

362}
363
364func TestActiveTCPConn_WriteLoop_WriteStreamingError(t *testing.T) {
365 defer test.CheckRoutines(t)()
366
367 tcpListener, err := net.Listen("tcp", "127.0.0.1:0") // nolint: noctx
368 require.NoError(t, err)
369 defer func() { _ = tcpListener.Close() }()
370
371 ra := netip.MustParseAddrPort(tcpListener.Addr().String())
372 logger := logging.NewDefaultLoggerFactory().NewLogger("ice")
373
374 ctx := t.Context()
375
376 a := newActiveTCPConn(ctx, "127.0.0.1:0", ra, logger)
377 require.NotNil(t, a)
378
379 srvConn, err := tcpListener.Accept()
380 require.NoError(t, err)
381
382 require.NoError(t, srvConn.Close())
383
384 n, err := a.WriteTo([]byte("data"), nil)
385 require.NoError(t, err)
386 require.Equal(t, len("data"), n)
387
388 require.NoError(t, a.Close())
389}
390
391func TestActiveTCPConn_LocalAddr_DefaultWhenUnset(t *testing.T) {
392 defer test.CheckRoutines(t)()

Callers

nothing calls this directly

Calls 8

newActiveTCPConnFunction · 0.85
AcceptMethod · 0.80
ListenMethod · 0.65
CloseMethod · 0.65
StringMethod · 0.65
EqualMethod · 0.65
NewLoggerMethod · 0.45
WriteToMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…