It appears that transmitting CHR$(0) characters via sockets fails. Rather than replicating all the details, please see the forum post which explains the problem with example code.
http://www.glbasic.com/forum/index.php?topic=3753.msg27399#msg27399 (http://www.glbasic.com/forum/index.php?topic=3753.msg27399#msg27399)
Try this:
"my message to sent via sockets\r\n"
SchranzOr, sorry, that won't help, I'm trying to transmit a binary file, not a text string.
Ive not used the Network commands yet but as GLB uses C strings I believe, so the networking command thinks when it hits a chr(0) then its at the end of the string. i.e. no more data, when it could be midway.
Simplest way is to encode the binary data into text, which for networking can have advantages if combined with simple compression like RLE.
Or simply convert your bytes to an ASCII hex string
EG...
255 15 0 255 = "FF0F00FF"
Then decode it at other end.
Or even a 3 character decimal number, eg 000028255
I'll probably go with 2 char hex, it means I only have to double the number of bytes sent which is probably the best (easy) solution. It's a lot easier than trying to MIME encode it or something equally as complex. Hopefully there'll be a GLBasic command solution for it at some point down the track.
Thanks for all the suggestions!!!!
It was a bug in SOCK_RECV. It's fixed in the next version.