Fix socket receive function

read() on socket may return without filling the complete buffer - even
in non-error conditions. Instead use recv() with MSG_WAITALL.
Merge pull request #3 from netactive/master

Fix socket receive function