Skip to content

tunnel-{source,sink}-new: reconnect

Craig Howard requested to merge c33howard/pulseaudio:tunnel-new-reconnect into master

Following the discussion in !687 (closed) here's a different approach to the same problem of reconnecting a tunnel to a remote server that has restarted.

This patch series creates reconnect.c, which integrates into the guts of tunnel-{source,sink}-new. Instead of having those modules directly send the unload request message, they call into reconnect.c, which will either send that message, or attempt call the majority of their init/done functions again instead.

Compared to the other approach, this has a cleaner config syntax, but is more invasive and requires work by each module to integrate. I removed the exponential back-off, because that's probably overkill and the config parsing is more complex internally with this approach.

Please take a look at my use of the control_msg queue; it seems to work, but I'm a bit confused as to the proper usage and I don't know if I did it right. I'm also unclear on the best way to handle parsing of arguments. I've passed pa_modargs into reconnect.c and it pulls out the reconnect parameter, but that means that valid_modargs doesn't work in reconnect.c and the calling module has to either not use valid_modargs or include the full set that reconnect.c may define internally.

Fixes: #875 (closed)

Edited by Craig Howard

Merge request reports