Uses code from Celluloid::IO PR#87

celluloid/celluloid-io#87
Merge pull request #104 from digitalextremist/patch-1

Uses code from Celluloid::IO PR#87