RPC port Map Failure Mac OSX 10.6 -
i m trying run programme using rpc of adding 2 numbers on mac osx 10.6
here doing:
rpcgen -a -c add.x
it generates files
add.h,add_clnt.c,add_svc.c,add_server.c,add_client.c
then compile files using:
gcc -g -drpc_svc_fg -c -o add_clnt.o add_clnt.c gcc -g -drpc_svc_fg -c -o add_client.o add_client.c gcc -g -drpc_svc_fg -c -o add_xdr.o add_xdr.c gcc -g -drpc_svc_fg -o add_client add_clnt.o add_client.o add_xdr.o gcc -g -drpc_svc_fg -c -o add_svc.o add_svc.c gcc -g -drpc_svc_fg -c -o add_server.o add_server.c gcc -g -drpc_svc_fg -o add_server add_svc.o add_server.o add_xdr.o
run server in 1 remote console
./add_server
run client in console
./add_client localhost 23 35
23 , 35 number sum want printed on sec console. when execute next nil appears on server console.
if seek ip address instead of localhost while running client error is:
rpc:port mapper failure
i using macosx 10.6
you there.
this done on solaris scheme , should see similar on macosx.
after starting add_server on remote host, check add_server has registered remote portmapper. e.g.
remote> cat add.x struct add_args { int a; int b; }; typedef struct add_args add_args; bool_t xdr_add_args(); #define addprog ((u_long)0x20000001) #define addvers ((u_long)1) #define add together ((u_long)1) extern int *add_1(); remote> ./add_server & remote> rpcinfo -t localhost 536870913 programme 536870913 version 1 ready , waiting
536870913 0x20000001 in decimal. see if remote host can reached local host. if yes, run add_client.
local> ping remote remote live local> rpcinfo -t remote 536870913 programme 536870913 version 1 ready , waiting local> ./add_clnt remote 23 35
osx port rpc
No comments:
Post a Comment