Re: [Rd] Question on non-blocking socket

2023-02-17 Thread Ben Engbers
Hi Tomas, Apparently, inserting some kind of socketSelect() is essential when using non-blocking sockets and a client/erve architecture. That is at least one thing that I have learned ;-). In C++, between sending and requesting, I inserted a call to this function: bool wait(int s) { fd_set

Re: [Rd] Question on non-blocking socket

2023-02-15 Thread Ben Engbers
Hi Op 15-02-2023 om 14:38 schreef Tomas Kalibera: On 2/15/23 01:24, Ben Engbers wrote: Hi, December 27, 2021 I started a thread asking for help troubleshooting non-blocking sockets. .. I have two questions. The first is where I can find R documentation on proper use of non-blocking

[Rd] Question on non-blocking socket

2023-02-15 Thread Ben Engbers
non-blocking sockets in general. Is it allowed to execute a read and a receive command immediately after each other or must a short waiting loop be built in. I'm asking this because I'm running into the same problems in a C++ project as I did with RBaseX. Ben Engbers

Re: [R-pkg-devel] Linking to a large external library

2022-06-10 Thread Ben Engbers
evelopment, but the API will be similar. Best wishes Matthias Am 10.06.2022 12:30 schrieb Ben Engbers : "rologlite" verwijst naar een .dll file. Ik neem dus aan dat deze package bedoeld is voor Windows. Mijn vraag is of "rologlite" ook gebruikt kan worden op Lin

Re: [R-pkg-devel] Linking to a large external library

2022-06-10 Thread Ben Engbers
"rologlite" verwijst naar een .dll file. Ik neem dus aan dat deze package bedoeld is voor Windows. Mijn vraag is of "rologlite" ook gebruikt kan worden op Linux? Zo ja, dan ben ik zeer benieuwd en ga ik kijken hoe ik dat voor mijn ontwikkelwerkzaamheden kan gebruiken? B

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

2021-12-08 Thread Ben Engbers
Hi Tomas, I saw that the attached file is missing, I therefore have added it below. In the examples in your reply from 11/27/21 8:05 PM, you use the command 'socketSelect(list(con2))'. I have replaced my Sys.sleep() command with 'socketSelect(list(conn))'. Execution-time for all the tests has

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

2021-12-08 Thread Ben Engbers
Op 08-12-2021 om 12:40 schreef Tomas Kalibera: On 12/8/21 12:20 PM, Ben Engbers wrote: Op 07-12-2021 om 23:49 schreef Ben Engbers: The new code, which now uses a non-blocking socket, takes less than 4 seconds to execute the 53 tests. Compared to the 120 seconds when using a blocking socket

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

2021-12-08 Thread Ben Engbers
Op 07-12-2021 om 23:49 schreef Ben Engbers: After a long nightly session, I ended up with inserting a wait between sending the authentication nonce and reading the status byte. writeBin(auth, private$conn) Sys.sleep(.1) Accepted <- readBin(conn, what = "raw", n = 1) The new co

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

2021-12-07 Thread Ben Engbers
Hi Tomas, I have implemented your suggestions as follows: (I'm not certain yet if the first check in done - total_length == 0 is realy needed) Creating the socket: CreateSocket = function(host, port = 1984L, username, password) { tryCatch( {conn <- private$conn <- socketConnection(

Re: [R-pkg-devel] CRAN submission error when running tests in testthat

2021-12-05 Thread Ben Engbers
Hi, I submitted the most recent version of my package to CRAN and to Macbuilder reported no problems. Best regards, Ben Op 25-11-2021 om 11:49 schreef Ivan Krylov: On Wed, 24 Nov 2021 16:37:44 + (UTC) Nathan Green via R-package-devel

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

2021-11-27 Thread Ben Engbers
I'll first finish the current development but then I will see if your suggestion is usefull. Ben Op 27-11-2021 om 20:19 schreef Tomas Kalibera: On 11/27/21 8:05 PM, Tomas Kalibera wrote: On 11/27/21 5:24 PM, Ben Engbers wrote: Op 27-11-2021 om 17:03 schreef Jeff Newmiller: This is a null

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

2021-11-27 Thread Ben Engbers
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

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

2021-11-27 Thread Ben Engbers
be determined. On Sat, Nov 27, 2021 at 4:09 AM Ben Engbers wrote: Hi, I have been working on a R-client for the BaseX XML-database and version 0.9.2 is nearly finished (submitting version 0.9.0 was rejected by CRAN). Version 0.3 of RBaseX can be found here (https://cran.microsoft.com/web

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

2021-11-27 Thread Ben Engbers
? Ben Engbers - CreateSocket = function(host, port = 1984L, username, password) { tryCatch( {conn <- private$conn <- socketConnection( host = "localhost", port, open = "w+b", server = FALSE, blocking

Re: [R-pkg-devel] Checking package in Windows fails

2021-11-16 Thread Ben Engbers
++ to speed up reading from the socketConnection. And in that version I'll try to use tour suggestions. Since I am new to C++ that will take some time. Ben Op 16-11-2021 om 21:22 schreef Ivan Krylov: On Mon, 15 Nov 2021 17:15:14 +0100 Ben Engbers wrote: I don't know why I have to explicitly

[R-pkg-devel] Checking package in Windows fails

2021-11-16 Thread Ben Engbers
Hi, I have written a function which - checks if the input is a raw-vector - if the input is a file-descriptor, it converts the file-content to a raw-vector - if the input is a URL, it converts the content to a raw vector - if the input is a character-string, it is converted to a raw vector.