{"record":{"id":"ed2a9d8a4ce369f5","repo":"AlexxIT/go2rtc","slug":"wrong-rtsp-conn-mode-d","errorCode":null,"errorMessage":"wrong RTSP conn mode: %d","messagePattern":"wrong RTSP conn mode: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/rtsp/conn.go","lineNumber":134,"sourceCode":"\t\t\t}\n\t\t} else {\n\t\t\ttimeout = time.Second * time.Duration(c.Timeout)\n\t\t}\n\n\tcase core.ModePassiveProducer:\n\t\t// polling frames from remote RTSP Client (ex FFmpeg)\n\t\tif c.Timeout == 0 {\n\t\t\ttimeout = time.Second * 15\n\t\t} else {\n\t\t\ttimeout = time.Second * time.Duration(c.Timeout)\n\t\t}\n\n\tcase core.ModePassiveConsumer:\n\t\t// pushing frames to remote RTSP Client (ex VLC)\n\t\ttimeout = time.Second * 60\n\n\tdefault:\n\t\treturn fmt.Errorf(\"wrong RTSP conn mode: %d\", c.mode)\n\t}\n\n\tfor i := 0; i < len(c.udpConn); i++ {\n\t\tgo c.handleUDPData(byte(i))\n\t}\n\n\tfor c.state != StateNone {\n\t\tts := time.Now()\n\n\t\t_ = c.conn.SetReadDeadline(ts.Add(timeout))\n\n\t\tif err = c.handleTCPData(); err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/rtsp/conn.go#L116-L152","documentation":"Handle was invoked on a connection whose mode is not one of the supported RTSP modes (active producer/consumer, passive producer/consumer), so timeout handling cannot be configured. Indicates an internal state bug — the mode value is printed.","triggerScenarios":"Thrown at pkg/rtsp/conn.go:134 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set a valid mode (ModePassiveProducer, ModePassiveConsumer, etc.) on the connection before Handle"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}