Update receiving algorithm on client side

We can assume the data will be received correctly because of using
the TCP connection to exchange the data.