in reply to So is this a kernel limitation, a hardware limitation, or a perl limitation?

Two things:
  1. The EAGAIN message is consistent with a write to an unavailable, non-blocking socket. It might have been placed into a non-blocking state before a connect call was issued and the script might be attempting to write to it before that connection was actually established. If the socket can't be written to yet, and you attempt to write to it, expect an EAGAIN "error" upon your write. This might just be due to a poor implementation of non-blocking IO.
  2. Instead of doing for (;;) { }, just sleep for a while. What you're basically doing is putting your script in a rather tight infinite loop, which will effectively hold your CPU usage at 100%. Most Unix kernels kind of figure that it's not doing anything productive and lower the priority of the process accordingly, so you might not notice any effects on other processes, but it would help diagnose the problem if your script was sleeping idly instead of working in a tight loop there. One less bit of activity on your system that might be catalyzing a separate problem.
  • Comment on Re: So is this a kernel limitation, a hardware limitation, or a perl limitation?
  • Download Code