VMware

This Question is Answered

1 "helpful" answer available (6 pts)
2 Replies Last post: Aug 28, 2008 1:01 PM by stumpr  

VI Perl Toolkit Times out... How to recover? posted: Aug 28, 2008 11:08 AM

Click to view Texiwill's profile Guru 10,205 posts since
Jan 13, 2004
Hello,

I have a long running VI Perl Toolkit program and would like to detect the timeout and respond to it by perhaps using Vim::load_session or Vim::logout/Vim::login.... How can I detect this time out of the session? Or does anyone have the length of time for which the session is good. I could not find it in the documentation.


Best regards,
Edward L. Haletky
VMware Communities User Moderator
====
Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.
CIO Virtualization Blog: http://www.cio.com/blog/index/topic/168354
As well as the Virtualization Wiki at http://www.astroarch.com/wiki/index.php/Virtualization

Re: VI Perl Toolkit Times out... How to recover?

1. Aug 28, 2008 11:47 AM in response to: Texiwill
Click to view c_shanklin's profile Master 754 posts since
Dec 3, 2007
The timeout is configurable in VC, and defaults to 30 minutes I believe.

To test your connection (or to keep it alive) you could retrieve the root folder, for example.

Re: VI Perl Toolkit Times out... How to recover?

2. Aug 28, 2008 1:01 PM in response to: Texiwill
Click to view stumpr's profile Expert 451 posts since
Sep 26, 2007
I usually test against the currentSession property to see if my session is still active and valid.

my $sc = Vim::get_service_content();
my $session_manager = $sc->sessionManager;

my $sm = Vim::get_view(mo_ref => $session_manager);

if ($sm->currentSession)
{
print "Valid Session: " . $sm->currentSession->key . "\n";
}
else
{
die "Invalid Session\n";
}

Developer Social Media

Communities