In procedure read-all-from-socket first read the size of the request and then read the rest. This should speed things up little bit