Error on trying to run a simple RPC program

arkiver picture arkiver · May 4, 2012 · Viewed 25.7k times · Source

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

rekenerd picture rekenerd · May 4, 2012

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