RPC clnt_create fails with RPC_UNKNOWNPROTO error.
When I run this (under Cygwin):
Code:
#include <stdio.h>#include <stdlib.h>
#include "rap.h"
#include <rpc/rpc.h>
clnt = clnt_create("s4c",300456,1,"TCP");
if(clnt==NULL) printf("Client is\tNULL\n");
if(clnt!=NULL) printf("Client is\tCREATED\n");
if(rpc_createerr.cf_stat==RPC_INTR) printf("RPC_INTR\n");
if(rpc_createerr.cf_stat==RPC_N2AXLATEFAILURE) printf("RPC_N2AXLATEFAILURE\n");
if(rpc_createerr.cf_stat==RPC_SYSTEMERROR) printf("RPC_SYSTEMERROR\n");
if(rpc_createerr.cf_stat==RPC_UNKNOWNHOST) printf("RPC_UNKNOWNHOST\n");
if(rpc_createerr.cf_stat==RPC_UNKNOWNPROTO) printf("RPC_UNKNOWNPROTO\n");
it comes back:
Client is NULL
RPC_UNKNOWNPROTO
I've tried:
clnt = clnt_create("s4c",300456,1,"TCP");
clnt = clnt_create("s4c",300456,1,"TCP");
clnt = clnt_create("192.168.2.1",300456,1,"tcp");
clnt = clnt_create("192.168.2.1",300456,1,"tcp");
I have confirmed that both the client and server machines are running tcp/ip.
Is "tcp" not the right protocol in Cygwin?
I know with SUN ONC it's actually ONCRPC_TCP.