newLISP Fan Club

Forum => newLISP in the real world => Topic started by: newdep on March 24, 2004, 02:37:11 PM

Title: net-functions
Post by: newdep on March 24, 2004, 02:37:11 PM
Hello Lutz,



When i use it in combination with C functions i need to put

and extra "00" 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 "00" terminated but the 'set makes it a list (string) which removes it again...



Just for the verification...



Norman..
Title:
Post by: Lutz on March 30, 2004, 07:20:26 AM
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 "0001020300") => 5 ; characters send



Computer two:



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



buff => "0001020300"



(string buff) => ""



Lutz