Okay, I have a linefeed, lol.
Its all about encoding, I was puzzled how a chr(10) could come from the server when a chr(10) couldnt be sent.
The socket class I wrote already had a raw byte property in its datarecieved event, so I examined that (its not encoded). I found that there are 3 bytes that decode to chr(10), those are chr(226),chr(128) and chr(169). Ironically, those bytes encode to "
". Your all laughing, right? Well, it isnt that simple, because you cannot decode "
" and get that 3 byte array (not using any decoder that ships with vbexpess, anyway), trust me, I tried them all. Of course, you could iterate through the string and build your byte array that way, and it would work like a charm, but you wouldnt be able to encode special characters correctly, and I wanted to keep that functionality).
What I did was make a new collection (of Byte), then use the .AddRange method to add all the characters upto the chr(10) (UTF8 encoded), then use the .Add method to add the 226, 128 and 169 and then .AddRange again for the rest of the characters (UTF8 encoded). I pass the whole array using the .ToArray method. Works like a charm. I am going to write a routine into the Send method of my program to replace "/r/n" with that byte sequence.
That should sort it.
Thanks for your help guys (n girls lol)