Hi, a couple of quick question on the problem I've been working on
for a couple of days now....

It quite simple really...how do you send an integer value as binary 
down a port ?

I want to do something like this

; start of simplified source snippet

server: open/binary tcp://127.0.0.1:9999

MakeMail: func[MailPath]
[


        CommandLength: make integer! length? MailPath

        insert server BinaryLength
        insert server MailPath
        

]

MakeMail "/boot/home/mail/in/firstmsg"
MakeMail "/boot/home/mail/in/secondmsg"

close server    

; end of source snippet

and the server  (written in 'C++') receives the path length as a long 
or short or whatever,
so if the length was 15 the buffer would hold 0x0F or 0x0F00 etc 
allowing for byte reversal,
and knows how much data is needed for the path.

the nearest I've got this to working is to use

        BinaryLength: make binary! (CommandLength) 

however probe BinaryLength just gives an empty binary #{} and the first 
thing
received in the buffer is the start of the path.

Any offers...?

Dave

BTW sorry about not sticking to the style guide but I've always found 
the
bracket on the end of the line thing  difficult to read.

Reply via email to