Backport #3526 from 2.0 to 1.6
- ReadPayload should not block in write
- ReadPayload should only return ErrPeerClosed if the write is closed, not the inverse. The error nil check is switched.
- ReadPayload should return io.EOF if the write side is still open, not ErrPeerClosed. ErrPeerClosed indicates that both sides of the connection are closed.
Backport #3526 from 2.0 to 1.6