@a-lurker, great to see a response from you. Thanks for trying it and finding a problem (albeit, of your own making, in the end?!)
@Buxton, great detective work. I had not seen that post previously.
Karma to you both for that.
It's been my philosophy never to alter a 'system' library, for just these reasons, except through the usual GitHub pull request mechanism, and even then you'll run into installed version incompatibilties. For this reason, I've been putting off (for years) delving into the LuaSocket library to see how I could do asynchronous I/O. However, it turns out that there is a legitimate, although undocumented, way of doing this, and the low-level library itself provides almost all the tools you need.
Regarding the confusion of file naming, it isn't really a problem because one is socket.http and the other openLuup.http and, in truth, you shouldn't need to touch either. However, I have been through this quandary before: the original file was called this, but then changed to openLuup.server but changed back per the comment in its header, when the server functionality became more general. I'll consider another name change. Ideas?
@amg0 has asked me whether this code will run on Vera, and I believe that with one small utility function to replace an openLuup scheduler call, then it could do just that. The technique is not limited to HTTP, since all the magic is actually happening at the TCP/socket level, but the code itself would need to be generalised a bit.
I just want this to get fully shaken down in VeraBridge before I try to widen its application.
Thanks both for your invaluable help.
PS: I've split this into a separate topic, since I think there may just be further discussion.