[Gambas-user] MkXXX$() functions

Benoît Minisini gambas at ...1...
Sat Jan 15 18:58:49 CET 2011


>    On 01/15/2011 09:14 AM, Benoît Minisini wrote:
> 
> Thanks it is more clear now, because the example of UDP usage of these
> functions i did not understand it.
> 
> Beware that these functions may be removed, and replaced by another way of
> forging UDP packets.
> 
>    [[1]Noooooooo...]  ;)  Please  let  us/me  know if you do, or what the
>    replacements will be.
>    The  functions are the logical extension of ASC() and STR(), which I'm
>    guessing  you'll  be  keeping out of respect for or compatibility with
>    old-school  BASIC.  Maybe  ASC()  and STR() could be removed, with the
>    documentation pointing to the new functions? ASC() and STR() could also
> be used to forge UDP packets and still suffer from the endianness issue.
> --
> Kevin Fishburne
> Eight Virtues
> www: [2]http://sales.eightvirtues.com
> e-mail: [3]sales at ...1887...
> phone: (770) 853-6271
> 

Here is what I thought when I have written that:

- Gambas has now structures.
- Structures contents can be written to a stream by the WRITE instruction.
- Streams have support for endianness.

Now, when you write something to an UDP socket, one writes equals one message, 
so you cannot send a message with successives writes.

Hopefully, when writing a structure, a temporary string is used for storing 
the intermediate writes, and so only one write is finally done to the UDP 
socket.

So, please, can you try that? Instead of using strings, create one structure 
for each message you send to your UDP socket, fill the structure with the 
message contents, and use the WRITE instruction to send the structure to it. 
And tell me if it works! :-) And if you finally find it cleaner or not.

Thanks in advance.

Regards,

-- 
Benoît Minisini




More information about the User mailing list