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

Function TestActiveTCPConn_ReadLoop_BufferWriteError

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

Source from the content-addressed store, hash-verified

335}
336
337func TestActiveTCPConn_ReadLoop_BufferWriteError(t *testing.T) {
338 defer test.CheckRoutines(t)()
339
340 tcpListener, err := net.Listen("tcp", "127.0.0.1:0") // nolint: noctx
341 require.NoError(t, err)
342 defer func() { _ = tcpListener.Close() }()
343
344 ra := netip.MustParseAddrPort(tcpListener.Addr().String())
345 logger := logging.NewDefaultLoggerFactory().NewLogger("ice")
346
347 ctx := t.Context()
348
349 a := newActiveTCPConn(ctx, "127.0.0.1:0", ra, logger)
350 require.NotNil(t, a)
351
352 srvConn, err := tcpListener.Accept()
353 require.NoError(t, err)
354
355 require.NoError(t, a.readBuffer.Close())
356
357 _, err = writeStreamingPacket(srvConn, []byte("ping"))
358 require.NoError(t, err)
359
360 require.NoError(t, a.Close())
361 require.NoError(t, srvConn.Close())
362}
363
364func TestActiveTCPConn_WriteLoop_WriteStreamingError(t *testing.T) {
365 defer test.CheckRoutines(t)()

Callers

nothing calls this directly

Calls 7

newActiveTCPConnFunction · 0.85
writeStreamingPacketFunction · 0.85
AcceptMethod · 0.80
ListenMethod · 0.65
CloseMethod · 0.65
StringMethod · 0.65
NewLoggerMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…