资源简介
rpc (网络通信例子)c语言(亲自测试过可以使用)
代码片段和文件信息
/*
* This is sample code generated by rpcgen.
* These are only templates and you can use them
* as a guideline for developing your own functions.
*/
#include “test.h“
#include “stdio.h“
void
testprog_1(char *host)
{
CLIENT *clnt;
char * *result_1;
char * test_1_arg;
#ifndef DEBUG
clnt = clnt_create (host TESTPROG VERSION “udp“);
if (clnt == NULL) {
clnt_pcreateerror (host);
exit (1);
}
#endif /* DEBUG */
result_1 = test_1(&test_1_arg clnt);
if (result_1 == (char **) NULL) {
clnt_perror (clnt “call failed“);
}
printf(“client get message::%s“*result_1);
#ifndef DEBUG
clnt_destroy (clnt);
#endif /* DEBUG */
}
int
main (int argc char *argv[])
{
char *host;
if (argc < 2) {
printf (“usage: %s server_host\n“ argv[0]);
exit (1);
}
host = argv[1];
testprog_1 (host);
exit (0);
}
- 上一篇:Hilbert变化的C语言实现
- 下一篇:教学计划编制系统文档
评论
共有 条评论