PROTIP: setting the timeout of socket_select to '0' makes it return immediately. This makes the while loop spin continuously and it chews up CPU like a mother.
Setting it to NULL makes it block indefinitely. As a result, it no longer chews up 100% of CPU.
Merge pull request #3 from NickZ/master

Setting socket_select to 'null' instead of '0' boosts performance tremendously.