Closed nickandrew closed 9 years ago
Work is in progress. I've got the proxy daemon running; just need to tidy the code. The ServerSocket
class was able to be modified in a logical way to use AnyEvent
while retaining almost identical API (which says to me that its API was very good in the first place).
I hacked AlarmDaemon::Controller
to replace the ListenSocket
and ClientSocket
classes with direct calls to AnyEvent->io
but this proved to be the wrong way to go about it when I got to ServerSocket
and realised that ServerSocket
is actually doing quite a lot which would be ugly to reimplement and I could do it by calling into the class handleRead
function from an AnyEvent->io
callback.
Nearly complete now. The daemon uses AnyEvent, and so do ordinary querying scripts which use LS30::Commander::sendCommand()
to send a command and receive a response.
I'd started to write modules to do asynchronous I/O built around a select() loop for several years and included my work to date into LS30. Since then I found AnyEvent which does a much better job of it, so rewrite the event loop parts of LS30 using AnyEvent.