Read the packets from socket correctly and pass them to the decoder.