ei_rpc vs. erl_rpc

Peter Strand <>
Wed Dec 11 13:12:57 CET 2002

On Fri, Dec 06, 2002 at 06:14:05PM +0100, Peter Strand wrote:
> I'm playing around a bit with erl_interface and have some
> trouble with the ei_rpc function, it failes with -1 and
> erl_errno == EIO when used as follows:
> 	ei_x_new(&x); ei_x_new(&x2);
> 	ei_x_format(&x, "[]");
> 	ei_rpc(&ec, fd, "net_adm", "localhost", x.buff, x.index, &x2);
> Am I doing anything wrong here?

Yes I was, the ei_rpc functions shouldn't have a version encoded
in the argument.

The documentation seems a bit weak in this area, the example for
ei_rpc both encodes and decodes the version byte, and it doesn't mention 
that ei_rpc does more decoding than ei_rpc_from, which can be a bit
surprising, at least it was for me before I looked at the source ;)

Oh well, it works great now.


More information about the erlang-questions mailing list