diff --git a/examples/server.go b/examples/server.go index c962f418..4b187b7b 100644 --- a/examples/server.go +++ b/examples/server.go @@ -11,6 +11,8 @@ import ( ) func handleConn(conn *gortsplib.ServerConn) { + defer conn.Close() + onRequest := func(req *base.Request) (*base.Response, error) { switch req.Method { case base.Options: diff --git a/serverconn.go b/serverconn.go index 14c9be4e..f84e4185 100644 --- a/serverconn.go +++ b/serverconn.go @@ -126,7 +126,6 @@ outer: } } - sc.nconn.Close() done <- errRet }