arkiver arkiver - 11 months ago 94
C Question

Error on trying to run a simple RPC program

I am trying to run a simple RPC program which I have created using rpcgen.
Its a simple factorial program. This is my first RPC program.
The make works fine.Executables are also created.
But when trying to run the executables, I get this error:

$sudo ./fact_server
Cannot register service: RPC: Unable to receive; errno = Connection refused
unable to register (FACTPROGRAM, FACTVERSION, udp).

I tried running the same program on another pc with the same OS (ubuntu). It runs perfect there.

Answer Source

First you check that portmapper is working or not, use rpcinfo to check it. If you get any error then install portmap