[TriLUG] Unix RPC question ( maybe the OpenNMS people might know this one).

H Brett Bolen brettb at trilug.org
Wed Feb 4 11:50:36 EST 2004


Phillip Rhodes wrote:

>> Does anybody know how to limit the amount of time that clnt_create() 
>> takes
>> to detect that a host is not running?  This is not restricted to rstat,
>> any RPC program would have this issue.
>>
> 
> You can set a client timeout using clnt_control(), in general.  What
> I'm not sure about is whether this applies to clnt_create() on Linux
> or not.  Some man pages I've seen ( here, for example:
> http://www.die.net/doc/linux/man/man3/clnt_create.3.html )
> specifically mention that the default timeout for
> clnt_create() can be modified using clnt_control(), but the man page
> on my Red Hat 9 box, for example, doesn't mention that.

You need a CLIENT* to use clnt_control(), so I don't see how this
will help.

There is also a timeout in clntudp_create() as I said earlier it
is for the rpc call, not the client create.

I think it is a general socket timeout, not related to RPC, because
telnet to a host that is down gives the same timeout.  I don't see
a socket option for this either.

I found a usenet post that suggested you could telnet to the
portmapper with a non-blocking socket first.  You can set
the timeout on the new socket to a lower amount and have some
control that way.   I may need to fall back to this option.

b²

-- 
b²

-----------------------
-- H Brett Bolen
-- TCNi
-- Phone: 919 550-0828
-- eFax : 443 535-8531






More information about the TriLUG mailing list