Use readexactly instead of read(). This fixes a bug when large replies are transmitted over the network.