Sockets not always loaded
API-sockets (server:port/sockets) are not always loaded, and page just returns completely blank page (200 OK). Nothing explains in log.
This seems to happen in case of multiple subscribers (players).
In my case, tested with 1 publisher, and 5 players. (It do happen with 4 playing streams as well, but not always)
v.1.1.0
Seeing this issue as well
/streams endpoint always works fine
Same here... Any chance to get that fixed?
I have added a log output to the concerning function. I guess that it is either related to an issue in the srtgo bindings on the srt lib itself. Please try it out and report back with the error. https://github.com/voc/srtrelay/commit/2f1b9f7415e1b74ac573a5236acb74e033d34926
It would also be good to know which srt version you are using
This remains an issue in version 1.3.0.
and remains an issue in version 1.4.0 as well.
Did you check the logs for relevant output? As @iSchluff mentioned, there is log output now for the case where something fails:
func (s *Server) HandleSockets(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
stats := s.srtServer.GetSocketStatistics()
if err := json.NewEncoder(w).Ecode(stats); err != nil {
log.Println(err)*
}
}
I cant seem to find any pattern in why something (or data) should become 'Not A Number'.
It happens with only one active connection as well. When it occurs, something remains 'NaN' as long as the connection is established and up. If connection restarts, the 'NaN' is typically gone again.
But the 'NaN' is the reason for sockets-page not loading properly.
If I could somehow see the data that the sockets page sees, then maybe I could look at the difference between when it works and when it doesn't. NaN could, in principle, just be a value that is negative and hasn't been accounted for I guess.