From 235cc4061beb967542b19c6be36d3ffdd8827a51 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sat, 30 Oct 2021 21:57:07 +0200 Subject: [PATCH] server: add missing check --- server.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/server.go b/server.go index f326d151..dfd4d752 100644 --- a/server.go +++ b/server.go @@ -68,7 +68,7 @@ type Server struct { // // handler // - // an handler interface to handle requests. + // an handler to handle server events. Handler ServerHandler // @@ -184,7 +184,11 @@ func (s *Server) Start(address string) error { } if s.TLSConfig != nil && s.UDPRTPAddress != "" { - return fmt.Errorf("TLS can't be used together with UDP") + return fmt.Errorf("TLS can't be used with UDP") + } + + if s.TLSConfig != nil && s.MulticastIPRange != "" { + return fmt.Errorf("TLS can't be used with UDP-multicast") } if (s.UDPRTPAddress != "" && s.UDPRTCPAddress == "") || @@ -292,14 +296,14 @@ func (s *Server) Start(address string) error { } // Close closes all the server resources. -// It doesn't wait for the server resources to shut down (use Wait for that). +// It doesn't wait for the server resources to close (use Wait for that). func (s *Server) Close() error { s.ctxCancel() return nil } -// Wait waits until all server resources are shut down. -// This can happen in case of a fatal error or when Close() is called. +// Wait waits until all server resources are closed. +// This can happen when a fatal error occurs or when Close() is called. func (s *Server) Wait() error { s.wg.Wait() return s.exitError