Stop reading when the socket is closed