0

I have this part of code:

Rconnection *rc = NULL;
rc = new Rconnection();
int stat=rc->connect();

Rmessage *msg=new Rmessage();
Rmessage *cmdMessage=new Rmessage(CMD_eval, "sumwe(2,3)");
int res=rc->request(msg,cmdMessage);
int r = CMD_STAT(msg->head.cmd);

as you can identify I have specified wrong R function name sumwe. For this I got in Rserve console by saying "Error: could not find function "sumwe""

But while checking value in r i.e CMD_STAT(msg->head.cmd); getting 127(hex 7f). I am expecting #define ERR_unsupportedCmd 0x49 /* unsupported command */ or #define ERR_unknownCmd 0x4a /* unknown command */ - the difference.`

Please help me what I am doing wrong.

details:

R version 2.15.0 (2012-03-30)
Rserve version  0.6-8 (338)
Platform Windows(32bit). Rserve running locally.
Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
sense
  • 1
  • 2

1 Answers1

0

The ERR_unsupportedCmd refers to the Rserve QAP1 protocol, i.e. commands like CMD_eval. You are sending a valid command CMD_eval so Rserve is not complaining -- the error is in R so regular R rules apply. As far as Rserve is concerned R aborted the evaluation. If you want the R error back, you can use try({...}, silent=TRUE) and you get an error as an object of class try-error containing the error string.

Simon Urbanek
  • 13,842
  • 45
  • 45