[R-pkg-devel] socketConnection, delay when reading from

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Sat Nov 27 17:53:29 CET 2021


Maybe time to learn it. At least to assemble complete messages.

That said, the design of this protocol is intrinsically inefficient. Maybe they will upgrade if the software gets popular.

On November 27, 2021 8:24:36 AM PST, Ben Engbers <Ben.Engbers using Be-Logical.nl> wrote:
>Op 27-11-2021 om 17:03 schreef Jeff Newmiller:
>> This is a null-terminated message protocol [1]. It has to be processed one byte at a time.
>> 
>> [1] https://docs.basex.org/wiki/Server_Protocol
>> 
>The message may contain embedded 0x00's. To distinguish these embedded 
>0x00's (and 0xFF's) from a terminating 0x00, embedded 0x00's and 0xFFare 
>prefixed with a 0xFF byte. This means that when you process one byte at 
>a time you have to perform a check on every byte. This results in 
>totally unacceptable response times (My first version of this client was 
>based on this approach)
>
>The only alternative solution I can think off is to use C++ to create a 
>socket and a function that reads from the socket. But since I have 
>hardly any experience with C++ programming nor using the rcpp package....
>
>Ben

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-package-devel mailing list