client: allow calling WriteFrame() when reading

This commit is contained in:
aler9
2021-03-28 17:55:40 +02:00
parent 4c5742354c
commit 1c88a7fee9
7 changed files with 181 additions and 84 deletions

View File

@@ -332,7 +332,7 @@ func TestServerReadFrames(t *testing.T) {
onFrame := func(trackID int, typ StreamType, buf []byte) {
require.Equal(t, 0, trackID)
require.Equal(t, StreamTypeRTCP, typ)
require.Equal(t, []byte("\x01\x02\x03\x04"), buf)
require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, buf)
close(framesReceived)
}
@@ -406,7 +406,7 @@ func TestServerReadFrames(t *testing.T) {
require.NoError(t, err)
defer l1.Close()
l1.WriteTo([]byte("\x01\x02\x03\x04"), &net.UDPAddr{
l1.WriteTo([]byte{0x01, 0x02, 0x03, 0x04}, &net.UDPAddr{
IP: net.ParseIP("127.0.0.1"),
Port: th.ServerPorts[1],
})
@@ -414,7 +414,7 @@ func TestServerReadFrames(t *testing.T) {
err = base.InterleavedFrame{
TrackID: 0,
StreamType: StreamTypeRTCP,
Payload: []byte("\x01\x02\x03\x04"),
Payload: []byte{0x01, 0x02, 0x03, 0x04},
}.Write(bconn.Writer)
require.NoError(t, err)
}