Add poll support
Merge pull request #5 from tqc/patch-1

Add poll support