From 5999fc69d88e5d647a8c1ce59f5f21a5bc4dc6b4 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sun, 27 Sep 2020 22:27:18 +0200 Subject: [PATCH] Try to fix SRT initialization --- stream/srt/srt.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stream/srt/srt.go b/stream/srt/srt.go index 88e1592..bc8b257 100644 --- a/stream/srt/srt.go +++ b/stream/srt/srt.go @@ -26,9 +26,10 @@ func Serve(cfg *Options) { s, err := sck.Accept() if err != nil { log.Println("Error occured while accepting request:", err) + continue } - go func() { + go func(s *sck.SrtSocket) { buff := make([]byte, 2048) for { n, err := s.Read(buff, 10000) @@ -42,6 +43,6 @@ func Serve(cfg *Options) { } log.Printf("Received %d bytes", n) } - }() + }(s) } }