Handle EOF with retry
Merge pull request #14 from heroku/issue-13

Handle EOF with retry