[vlc-devel] VLC Lua TCP - poll for incoming text?
Rémi Denis-Courmont
remi at remlab.net
Mon Jun 19 14:50:34 UTC 2023
Le maanantaina 19. kesäkuuta 2023, 5.46.13 EEST Chris Angelico a écrit :
> Currently, the vlc.net.poll() function always and only has an infinite
> timeout. In an extension, this will result inevitably in a watchdog
> timer expiration if the other end of the socket takes more than 10
> seconds to respond.
There are not many protocols where there is a time-out, which is not the
built-in time-out of the TCP protocol. And those typically would need to be
implemented natively anyhow.
So having a timeout for poll() would only enable nasty hacks notably power-
save-hostile arbitrary polling timers.
> In order to allow an extension to react to signals from another
> application, it would be extremely useful to be able to either:
> 1) Poll without fear of timeout - while inside vlc.net.poll(), the
> watchdog is disabled; or
You can do that. You just need to do it in a dedicated interface, which gets
its own thread.
> 2) Poll with a limit of (say) 5 seconds, resulting in a zero return
> and a chance to call vlc.keep_alive(); or
That's well-known to be bad and harmful, so not happening.
> 3) Have an extension request notification on fd readability.
In other words, a main loop.
That's OK in principles. It might not be easy to implement though. The
extension code is notoriously half-assed and mostly unmaintained. (The
original author promised to clean it up to bypass review comments, then
promptly vanished.)
--
雷米‧德尼-库尔蒙
http://www.remlab.net/
More information about the vlc-devel
mailing list