Page 1 of 1

net-functions

Posted: Wed Mar 24, 2004 10:37 pm
by newdep
Hello Lutz,

When i use it in combination with C functions i need to put
and extra "\000" at the end of every received n-size buffer data using a 'set.

When I use i.e. (set 'buff (net-receieve ....)) its probably by origin "\000" terminated but the 'set makes it a list (string) which removes it again...

Just for the verification...

Norman..

Posted: Tue Mar 30, 2004 3:20 pm
by Lutz
actually only the (print ..) or (println ..) and (string ...) function strips the 'C' zero. 'get-string' will also do it, so when you use 'get-string' on an imported 'C' function and then do net-send that string you will not send the trailing zero. But else 'set' and the 'net-functions' in pretty much all other functions working on string-buffers can work on binary data:

'set' and the net-xxxx fucntions don't do this:

Computer one:

(net-send socket "\000\001\002\003\000") => 5 ; characters send

Computer two:

(net-receive sock 'buff 20) => 5 ; characters received

buff => "\000\001\002\003\000"

(string buff) => ""

Lutz