[NUG] API 2.0
npalardy at airenet.com
npalardy at airenet.com
Wed Mar 13 17:26:45 CDT 2019
> On Mar 13, 2019, at 2:38 PM, Tim Streater <timstreater at greenbee.net> wrote:
>
> 3) Xojo sockets don't have a getline() method so I had to create my own using socket.readall and then return data line by line, doing timeout and error handling too. Fastest way (performance-wise) at the bottom was to keep this sort of intermediate data in byte arrays.
Right - sockets read BYTES not encoded text, lines of text, etc
If thats what you need then that is effectively your "protocol" on top of the underlying socket (ie think HTTP which is just a well defined sequence of bytes defined in the RFC about how HTTP sends & receives data and how it should be formed)
The best thing to do has always been to, in the data received event, grab all the bytes, shove them in a buffer and then have a timer or thread or something else deal with pulling out the "lines" (or whatever) from that buffer so you keep data coming in fast as heck
More information about the Nug
mailing list