remove return value from Close()

This commit is contained in:
aler9
2023-08-14 11:07:52 +02:00
parent e26ccf0858
commit 1a3e6ad092
6 changed files with 5 additions and 23 deletions

View File

@@ -52,11 +52,6 @@ linters-settings:
- (github.com/datarhei/gosrt.Conn).Close - (github.com/datarhei/gosrt.Conn).Close
- (github.com/datarhei/gosrt.Conn).SetReadDeadline - (github.com/datarhei/gosrt.Conn).SetReadDeadline
- (github.com/datarhei/gosrt.Conn).SetWriteDeadline - (github.com/datarhei/gosrt.Conn).SetWriteDeadline
- (*github.com/bluenviron/gortsplib/v4.Client).Close
- (*github.com/bluenviron/gortsplib/v4.Server).Close
- (*github.com/bluenviron/gortsplib/v4.ServerSession).Close
- (*github.com/bluenviron/gortsplib/v4.ServerStream).Close
- (*github.com/bluenviron/gortsplib/v4.ServerConn).Close
govet: govet:
enable-all: true enable-all: true

View File

@@ -461,12 +461,9 @@ func (c *Client) StartRecording(address string, medias media.Medias) error {
} }
// Close closes all client resources and waits for them to close. // Close closes all client resources and waits for them to close.
func (c *Client) Close() error { func (c *Client) Close() {
c.ctxCancel() c.ctxCancel()
<-c.done <-c.done
// TODO: remove return value in next major version
return c.closeError
} }
// Wait waits until all client resources are closed. // Wait waits until all client resources are closed.

View File

@@ -318,12 +318,9 @@ func (s *Server) Start() error {
} }
// Close closes all the server resources and waits for them to close. // Close closes all the server resources and waits for them to close.
func (s *Server) Close() error { func (s *Server) Close() {
s.ctxCancel() s.ctxCancel()
s.wg.Wait() s.wg.Wait()
// TODO: remove return value in next major version
return s.closeError
} }
// Wait waits until all server resources are closed. // Wait waits until all server resources are closed.

View File

@@ -110,10 +110,8 @@ func newServerConn(
} }
// Close closes the ServerConn. // Close closes the ServerConn.
func (sc *ServerConn) Close() error { func (sc *ServerConn) Close() {
sc.ctxCancel() sc.ctxCancel()
// TODO: remove return value in next major version
return nil
} }
// NetConn returns the underlying net.Conn. // NetConn returns the underlying net.Conn.

View File

@@ -195,10 +195,8 @@ func newServerSession(
} }
// Close closes the ServerSession. // Close closes the ServerSession.
func (ss *ServerSession) Close() error { func (ss *ServerSession) Close() {
ss.ctxCancel() ss.ctxCancel()
// TODO: remove return value in next major version
return nil
} }
// BytesReceived returns the number of read bytes. // BytesReceived returns the number of read bytes.

View File

@@ -56,7 +56,7 @@ func (st *ServerStream) initializeServerDependentPart() {
} }
// Close closes a ServerStream. // Close closes a ServerStream.
func (st *ServerStream) Close() error { func (st *ServerStream) Close() {
st.mutex.Lock() st.mutex.Lock()
st.closed = true st.closed = true
st.mutex.Unlock() st.mutex.Unlock()
@@ -68,9 +68,6 @@ func (st *ServerStream) Close() error {
for _, sm := range st.streamMedias { for _, sm := range st.streamMedias {
sm.close() sm.close()
} }
// TODO: remove return value in next major version
return nil
} }
// Medias returns the medias of the stream. // Medias returns the medias of the stream.