<!DOCTYPE html><html><head><meta charset="UTF-8"><style type="text/css">body { font-family: Monaco, Courier New, monospace; font-size: 12px; height: 100%; margin: 0px; margin-left: 5px; margin-top: 5px; } p { margin: 0; margin-left: 5px; } .ql-font-monospace { font-family: Monaco, Courier New, monospace; } .ql-font-sans { font-family: Helvetica, Arial, sans-serif; } .ql-font-serif { font-family: Georgia, Times New Roman, serif; } .ql-size-tiny { font-size: 0.6em; } .ql-size-small { font-size: 0.85em; } .ql-size-normal { font-size: 1.0em; } .ql-size-large { font-size: 1.4em; } .ql-size-big { font-size: 2.0em; } .ql-size-huge { font-size: 2.5em; } .ql-direction-rtl { direction: rtl; text-align: inherit; } .ql-align-center { text-align: center; } .ql-align-justify { text-align: justify; } .ql-align-right { text-align: right; }</style></head><body><p>On 13 Mar 2019, at 22:26, "npalardy@airenet.com" <npalardy@airenet.com> wrote:</p><p><br></p><p>>> On Mar 13, 2019, at 2:38 PM, Tim Streater <timstreater@greenbee.net> wrote:</p><p>>> </p><p>>>  3) Xojo sockets don't have a getline() method so I had to create my own</p><p>>> using socket.readall and then return data line by line, doing timeout and</p><p>>> error handling too. Fastest way (performance-wise) at the bottom was to keep</p><p>>> this sort of intermediate data in byte arrays.</p><p>></p><p>> Right - sockets read BYTES not encoded text, lines of text, etc</p><p>></p><p>> If thats what you need then that is effectively your "protocol" on top of the</p><p>> underlying socket (ie think HTTP which is just a well defined sequence of</p><p>> bytes defined in the RFC about how HTTP sends & receives data and how it</p><p>> should be formed)</p><p>></p><p>> The best thing to do has always been to, in the data received event, grab all</p><p>> the bytes, shove them in a buffer and then have a timer or thread or something</p><p>> else deal with pulling out the "lines" (or whatever) from that buffer so you</p><p>> keep data coming in fast as heck</p><p><br></p><p>Yes, just what I ended up doing. Perhaps it would be clearer, though, if the ReadAll doc pushed us towards reading into a memoryblock, one that could be converted to a string and sanitised without being copied too often. I found I had to go back and forth between old and new framework to get what I needed, with a data copy at each stage, although I did manage to eliminate some of those.</p><br><br>-- <br>Cheers  --  Tim</body></html>