Running alarm in a loop causes "Socket already connected" errors?

Working on this issue with UI in “real” pack, I tried a quick workaround using:

r_ui_loop :-
  <- invisible(,
  alarm(0.1, r_ui_loop, _, [install(true), remove(true)]).

It worked to address the issue of R plot window being unresponsive. However, I suddenly started getting Socket error: Socket is already connected in my http client code.

I first thought calling out to R messes up something, but the problem persists when I reduce the problematic loop to: r_ui_loop :- alarm(0.1, r_ui_loop, _, [install(true), remove(true)]).

Any idea what’s going on?

I think this is a bug, I’ve opened an issue here in case someone stumbles upon the same problem.

1 Like

Merged your PR. Thanks.