close bug #34: read all requested bytes from the socket