Update SRTP server constructor

This commit is contained in:
Alexey Khit
2023-09-02 07:37:49 +03:00
parent 60d7d525f2
commit 7fdc6b9472
+4 -5
View File
@@ -15,7 +15,10 @@ type Server struct {
}
func NewServer(address string) *Server {
return &Server{address: address}
return &Server{
address: address,
sessions: map[uint32]*Session{},
}
}
func (s *Server) Port() int {
@@ -46,10 +49,6 @@ func (s *Server) AddSession(session *Session) {
session.conn = s.conn
if s.sessions == nil {
s.sessions = map[uint32]*Session{}
}
s.sessions[session.Remote.SSRC] = session
}