optimise server code: to recv the data block by block, with each block size equal 512