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

Function writeStreamingPacket

tcp_mux.go:472–483  ·  view source on GitHub ↗
(conn net.Conn, buf []byte)

Source from the content-addressed store, hash-verified

470}
471
472func writeStreamingPacket(conn net.Conn, buf []byte) (int, error) {
473 bufCopy := make([]byte, streamingPacketHeaderLen+len(buf))
474 binary.BigEndian.PutUint16(bufCopy, uint16(len(buf))) //nolint:gosec // G115
475 copy(bufCopy[2:], buf)
476
477 n, err := conn.Write(bufCopy)
478 if err != nil {
479 return 0, err
480 }
481
482 return n - streamingPacketHeaderLen, nil
483}

Callers 6

TestTCPMux_RecvFunction · 0.85
newActiveTCPConnFunction · 0.85
WriteToMethod · 0.85
TestMultiTCPMux_RecvFunction · 0.85

Calls 1

WriteMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…