Resolved previous commit bug.

If a client close the socket in a clean way, the function
recv(...) return 0 not -1.
We now control also the size of recived data