Not really a direct answer, but consider using POE (wiki).
In reply to Re: IO:Socket question... sort of :) by Fletch in thread IO:Socket question... sort of :) by marcs