Quote Originally Posted by test user View Post
... but in buf I have just 2 strange char [which in a later post are revealed to be] just 2 characters i.e. a space and Ò

... but recvbuf has 2 strange variables, casting it to int and converting ASCII value to bits give me just 2*8=16 bits.
It's not possible to get the characters codes for "space and Ò" in just 16 bits. The "Ò", for example, is a Unicode character, and for that character alone, at least 16 bits are required.

As Paul mentions, you are probably not interpreting your received results correctly. You might, for example (and as Paul notes), be using string-based functions to interpret the results. No string-based functions should ever be used directly on the buffer received in a TCP connection.

Please let us see your code for interpreting the results of the received buffer.

And please give us more information on the server that is sending the buffer. If you have the code for it, please let us see the sending code too. If you don't have the code, please give us information about the server (e.g., is it an HTTP server on the web, sending data in accordance with a specific protocol?)

Mike