srtrelay icon indicating copy to clipboard operation
srtrelay copied to clipboard

Sockets not always loaded

Open DigibitDK opened this issue 2 years ago • 9 comments

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

DigibitDK avatar Nov 09 '23 11:11 DigibitDK

Seeing this issue as well

pkmdev avatar Nov 17 '23 02:11 pkmdev

/streams endpoint always works fine

pkmdev avatar Nov 17 '23 02:11 pkmdev

Same here... Any chance to get that fixed?

netaviator avatar May 14 '24 07:05 netaviator

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

iSchluff avatar Jun 11 '24 10:06 iSchluff

This remains an issue in version 1.3.0.

DigibitDK avatar Dec 29 '24 20:12 DigibitDK

and remains an issue in version 1.4.0 as well.

DigibitDK avatar Jun 23 '25 18:06 DigibitDK

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)*
	}
}

danimo avatar Jun 23 '25 21:06 danimo

Image

DigibitDK avatar Jul 01 '25 19:07 DigibitDK

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.

DigibitDK avatar Jul 01 '25 19:07 DigibitDK