albertosantini / node-rio

Integration with Rserve, a TCP/IP server for R framework
https://github.com/albertosantini/node-conpa
MIT License
176 stars 35 forks source link

problem with long time consuming R functions #3

Closed ghost closed 11 years ago

ghost commented 11 years ago

hello, albertosantini , have you encountered a situation that

when running long time cousuming R functions, the callback didn't return any thing , just hanging here.

when rio.enableDebug yes, you can saw the result from terminal with just

Disconnected from Rserve
Close from Rserve
ghost commented 11 years ago

got a new response from rio.enableDebug

Rserve exception - Error: read ECONNRESET
albertosantini commented 11 years ago

@uxnow , you can reproduce the problem with the following command: rio.evaluate("Sys.sleep(130); 11");

Somewhere there is a 120 secs timeout.

If it is ok for you, I publish a new release.

ghost commented 11 years ago

thanks, and I suggest a little change of code so ut8 encoded response could be processed. line 115

    } else if (ra === 34) { // string array
        oi = i;
        while (i < eoa) {
            if (r[i] === 0) {
                res.push(r.toString("ascii", oi, i)); // -> res.push(r.toString("utf8", oi, i));
                oi = i + 1;
            }
            i += 1;
        }
albertosantini commented 11 years ago

Done. Published 0.8.1.

Thanks for the feedback.

ghost commented 11 years ago

GREAT!