From fbb1285025abe0e19d584a74e2d76f6d63d2b310 Mon Sep 17 00:00:00 2001 From: danil_e71 Date: Fri, 20 May 2022 10:56:19 +0300 Subject: [PATCH] add timeout, return 0 instead 1 code --- example/file/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/example/file/main.go b/example/file/main.go index 4e7d930..515187b 100644 --- a/example/file/main.go +++ b/example/file/main.go @@ -4,6 +4,7 @@ import ( "io" "net/http" "os" + "time" "github.com/Danile71/go-logger" "github.com/Danile71/go-rtsp" @@ -23,10 +24,11 @@ func main() { go func() { for { + time.Sleep(time.Millisecond * 4) pkt, err := stream.ReadPacket() if logger.OnError(err) { if err == io.EOF { - os.Exit(1) + os.Exit(0) } continue }