无法连接$远程过程调用服务器注册号C $ C参数 [英] Can't Encode Arguments in Remote Procedure Call for Server Registration

查看:258
本文介绍了无法连接$远程过程调用服务器注册号C $ C参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要有点疯狂试图找出为什么这是行不通的。我使用sunrpc,但生成的服务器code抛出以下内容:

I'm going a bit crazy trying to figure out why this isn't working. I'm using sunrpc, but the generated server code throws the following:

无法注册服务:RPC:无法连接code参数

  无法注册(MYRPC,MYRPC_V1,UDP)。

Cannot register service: RPC: Can't encode arguments
unable to register (MYRPC, MYRPC_V1, udp).

我不知道为什么会这样。我做以下,以生成stub:

I have no idea why this is happening. I'm doing the following to generate the stubs:

$ rpcgen -NMC myrpc.x

下面是我的XDR

struct imgdata{
    opaque data<>;
};

program MYRPC {
    version MYRPC_V1 {
        imgdata minify(imgdata) = 1;
    } = 1;
} = 0x30D0D0DFF;

我不明白编译.X文件来创建客户端,服务器,XDR编组code或头部的任何错误。我也实现了RPC接口,但由于该错误被抛出我尝试加速旋转产生的服务器(myrpc_svr.c)的那一刻一直无法对其进行测试。

I don't get any errors compiling the .x file to create the client, server, xdr marshalling code, or the header. I've also implemented the rpc interface, but haven't been able to test it since that error is thrown the moment I attempt to spin up the generated server (myrpc_svr.c).

什么是变量此错误信息甚至指?它不喜欢我实现了XDR定义我的功能?为什么编码参数导致程序甚至没有注册?

What arguments is this error message even referring? Does it not like my implementation of my function defined in the XDR? Why would an encoding argument cause the program to not even register?

实际上我非常惊讶,这不是一个客户端的错误消息

I'm actually very surprised that this isn't a client side error message

推荐答案

事实证明,答案是如此简单经过的时间浪费时间:程序编号超出范围

After hours of wasted time it turns out the answer was so simple: The Program Number is out of range.

program MYRPC {
    version     MYRPC_V1 {
        imgdata minify(imgdata) = 1;
    } = 1;
} = 0x30D0D0DFF;

我的计划数 0x30D0D0DFF 包含一个额外的数字, ˚F导致了此值是出于范围在RFC 1831 的部分7.3规范允许用户自定义的程序号。它应该是:

My Program Number 0x30D0D0DFF contains an extra digit, F at the end causing this value to be out of range for allowed user-defined program numbers per the specification in section 7.3 of RFC 1831. It should have been:

0x30D0D0DF

所以,这只是一个细微的拼写错误,虽然写了XDR文件我胖手指,但我的情况下,任何人离开这个了运行到同样的问题。确保您的程序编号是正确的!

So this is just a subtle typo that I fat fingered while writing up the XDR file, but I'm leaving this up in case anyone else runs into the same problem. Make sure your program number is correct!

这篇关于无法连接$远程过程调用服务器注册号C $ C参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆