golanggohlsrtmpwebrtcmedia-serverobs-studiortcprtmp-proxyrtmp-serverrtprtsprtsp-proxyrtsp-relayrtsp-serversrtstreamingwebrtc-proxy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
592 B
33 lines
592 B
package webrtc |
|
|
|
import ( |
|
"testing" |
|
"time" |
|
|
|
"github.com/bluenviron/mediamtx/internal/test" |
|
"github.com/stretchr/testify/require" |
|
) |
|
|
|
func TestPeerConnectionCloseAfterError(t *testing.T) { |
|
api, err := NewAPI(APIConf{ |
|
LocalRandomUDP: true, |
|
IPsFromInterfaces: true, |
|
}) |
|
require.NoError(t, err) |
|
|
|
pc := &PeerConnection{ |
|
API: api, |
|
Publish: false, |
|
Log: test.NilLogger{}, |
|
} |
|
err = pc.Start() |
|
require.NoError(t, err) |
|
|
|
_, err = pc.CreatePartialOffer() |
|
require.NoError(t, err) |
|
|
|
// wait for ICE candidates to be generated |
|
time.Sleep(500 * time.Millisecond) |
|
|
|
pc.Close() |
|
}
|
|
|