Fun with sockets

Posted by cuervo
In Main
30Jan 09

My mail filter announces incoming mail as it comes in — for spam, it just plays a short wav, one of the sound effects from SOCOM: US Navy Seals. For ham, though, it feeds a brief summary through the speech synthesizer: the sender address, and the subject line (or “No subject”).

When the laptop is up, it acts as my primary MX. When it’s off (e.g., overheated), Google acts as my backup MX, and when my laptop comes back up, it runs fetchmail from cron.

The problem with this is that the speech synth tends to step on itself. I’ll get two or three speech processes, all trying to announce different messages at the same time.

The obvious solution: queue them all up and let a seperate process serialize them via Unix sockets. I could just have each process acquire a lock on the synthesizer, but in case of massive email floods, say, when I’ve been away for a week or two, it’d just cause timeouts and deferrals.

The server I use is here, and the client that feeds it is here. I may or may not update them on the site as I improve the code.


Subscribe to RSS

Syndicate