in reply to socket read problem

Might be prudent to clear out your buffer variable before reading, as well as checking the return value from your recv and see if that's producing an error.

The cake is a lie.
The cake is a lie.
The cake is a lie.