Ok, a bit messy with the strings and your hard-coded msglen (4) etc, but here's 
where I got to:

* * *

There's a couple of superfluous cast[pointer] in my original, in both send and 
recv message. They were left over from developing (they have no effect because 
they were just casting pointer -> pointer), code looks a bit cleaner when just 
directly using the buffer pointer passed in (no cast needed).

look for and change:
    

  * cast[pointer](buffer) -> buffer (two occurences)
  * cast[pointer](data) -> data



* * *

The address of a cstring var is not the same as the data location, you need the 
allocated memory addr at char[0], so in client prog need:
    data[][0].addr, # data to send

* * *

In the server prog I changed the type of Msg to: type Msg = array[50,char] and 
remove init of var b:Msg #= "ABC"

* * *

This gets the strings being passed across, but some more understanding and 
re-factoring are probably in order

Hope this helps 

Reply via email to