mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 23:26:54 +08:00
server: test connection timeout
This commit is contained in:
@@ -993,10 +993,14 @@ func TestServerPublishErrorTimeout(t *testing.T) {
|
|||||||
"tls",
|
"tls",
|
||||||
} {
|
} {
|
||||||
t.Run(proto, func(t *testing.T) {
|
t.Run(proto, func(t *testing.T) {
|
||||||
|
connClosed := make(chan struct{})
|
||||||
sessionClosed := make(chan struct{})
|
sessionClosed := make(chan struct{})
|
||||||
|
|
||||||
s := &Server{
|
s := &Server{
|
||||||
Handler: &testServerHandler{
|
Handler: &testServerHandler{
|
||||||
|
onConnClose: func(sc *ServerConn, err error) {
|
||||||
|
close(connClosed)
|
||||||
|
},
|
||||||
onSessionClose: func(ss *ServerSession, err error) {
|
onSessionClose: func(ss *ServerSession, err error) {
|
||||||
close(sessionClosed)
|
close(sessionClosed)
|
||||||
},
|
},
|
||||||
@@ -1126,6 +1130,10 @@ func TestServerPublishErrorTimeout(t *testing.T) {
|
|||||||
require.Equal(t, base.StatusOK, res.StatusCode)
|
require.Equal(t, base.StatusOK, res.StatusCode)
|
||||||
|
|
||||||
<-sessionClosed
|
<-sessionClosed
|
||||||
|
|
||||||
|
if proto == "tcp" {
|
||||||
|
<-connClosed
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user