s-u / REngine

General Java interface to R supporting multiple back-ends such as JRI and Rserve
Other
67 stars 47 forks source link

Test control commands fails #1

Closed cemmersb closed 10 years ago

cemmersb commented 11 years ago

I was checking the test for control commands, i.e. the serverEval command.

String key = "rn" + Math.random();
c.serverEval("xXx<-'" + key + "'");

When executing the test the serverEval command, I'm facing an error. The following method in class 'RPacket' fails:

/**
 * check last response for RESP_OK
 *
 * @return <code>true</code> if last response was OK
 */
public boolean isOk() {
  return ((cmd & 15) == 1);
}

Value for the generated command was: xXx<-'rn0.4893878029775939'

The converted rp cmd is: 1308688386

I have not enough knowledge about how the bitwise AND operator should be applied for checking if the command is OK.

s-u commented 10 years ago

The result you get is an error (cmd & 15 = 2) the error code (0x4e) is ERR_ctrl_closed so you didn't enable control commands in the Rserve instance you're connecting to.

Please use stats-rosuda-devel mailing lists for questions about Rserve usage.