Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/rpc Use TCP to register RPC services with the portm...
details: https://anonhg.NetBSD.org/src/rev/4079511d9cf0
branches: trunk
changeset: 471990:4079511d9cf0
user: drochner <drochner%NetBSD.org@localhost>
date: Sat Apr 17 13:16:39 1999 +0000
description:
Use TCP to register RPC services with the portmapper.
This has the advantage that we get an immediate error in case of
network problems (loopback, actually) instead of a nasty timeout.
diffstat:
lib/libc/rpc/pmap_clnt.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diffs (64 lines):
diff -r 2ad3b45f8043 -r 4079511d9cf0 lib/libc/rpc/pmap_clnt.c
--- a/lib/libc/rpc/pmap_clnt.c Sat Apr 17 13:00:04 1999 +0000
+++ b/lib/libc/rpc/pmap_clnt.c Sat Apr 17 13:16:39 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_clnt.c,v 1.12 1999/03/25 01:16:11 lukem Exp $ */
+/* $NetBSD: pmap_clnt.c,v 1.13 1999/04/17 13:16:39 drochner Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
static char *sccsid = "@(#)pmap_clnt.c 1.37 87/08/11 Copyr 1984 Sun Micro";
static char *sccsid = "@(#)pmap_clnt.c 2.2 88/08/01 4.0 RPCSRC";
#else
-__RCSID("$NetBSD: pmap_clnt.c,v 1.12 1999/03/25 01:16:11 lukem Exp $");
+__RCSID("$NetBSD: pmap_clnt.c,v 1.13 1999/04/17 13:16:39 drochner Exp $");
#endif
#endif
@@ -59,7 +59,6 @@
__weak_alias(pmap_unset,_pmap_unset);
#endif
-static const struct timeval timeout = { 5, 0 };
static const struct timeval tottimeout = { 60, 0 };
/*
@@ -74,15 +73,15 @@
u_short port;
{
struct sockaddr_in myaddress;
- int socket = -1;
+ int socket = RPC_ANYSOCK;
CLIENT *client;
struct pmap parms;
bool_t rslt;
if (get_myaddress(&myaddress) != 0)
return (FALSE);
- client = clntudp_bufcreate(&myaddress, PMAPPROG, PMAPVERS,
- timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
+ client = clnttcp_create(&myaddress, PMAPPROG, PMAPVERS,
+ &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
if (client == (CLIENT *)NULL)
return (FALSE);
parms.pm_prog = program;
@@ -108,15 +107,15 @@
u_long version;
{
struct sockaddr_in myaddress;
- int socket = -1;
+ int socket = RPC_ANYSOCK;
CLIENT *client;
struct pmap parms;
bool_t rslt;
if (get_myaddress(&myaddress) != 0)
return (FALSE);
- client = clntudp_bufcreate(&myaddress, PMAPPROG, PMAPVERS,
- timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
+ client = clnttcp_create(&myaddress, PMAPPROG, PMAPVERS,
+ &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
if (client == (CLIENT *)NULL)
return (FALSE);
parms.pm_prog = program;
Home |
Main Index |
Thread Index |
Old Index