read all the data, then release the socket