RPC:portmap运行时出现超时错误

时间:2017-04-03 20:31:02

标签: c++ c linux rpc

当我尝试使用以下内容注册应用程序时,我收到了一个" RPC:Timed out"错误

if (!svc_register(transp, AVERAGEPROG, AVERAGEVERS, averageprog_1, IPPROTO_TCP)) {
    fprintf (stderr, "%s", "unable to register (AVERAGEPROG, AVERAGEVERS, tcp).");
    exit(1);                                                                  
}

我已经重新启动了portmap服务,但是这没有用。此外,我检查确保我没有hosts.deny文件,所以我知道这里没有阻止连接。使用

rpcinfo -p <host>

我得到以下输出:

program vers proto   port
100000    2   tcp    111  portmapper
100000    2   udp    111  portmapper

表示portmap正在运行。是否有我遗漏的东西导致portmap阻止传入的RPC应用程序?

1 个答案:

答案 0 :(得分:0)

通过使用ifconfig启用环回接口解决了这个问题:

$ ifconfig lo 127.0.0.1 

Portmap似乎需要这样才能映射RPC应用程序。