Fixed EOF code

Does this logic need to be moved to read? Do we even need to get to
calling read on the receiving end?