Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Waituntil and connection status

Status
Not open for further replies.

cryptotech

Technical User
Nov 9, 2007
26
US
I'm using the waituntil "22:00:00" command to execute a script, but while waiting for that time I need to keep the connection alive by sending something every 5 minutes or so.
I've used the while loop to keep it alive, but how do I execute the waituntil at the same time?

How do I keep the connection alive when the waituntil is waiting.

thanks,
 
Here is a script I copied from my site that will send a carriage return every five minutes (300 seconds) if no characters have been received from the host:

proc main
when quiet 300 call sendit

while 1
yield
endwhile
endproc

proc sendit
transmit "^M"
endproc

In your case, you wouldn't need the while 1/endwhile loop, although I have not tested to see if the script can jump away from the waituntil command to call the sendit procedure.

 
Thanks,
Getting away from the waituntil is where I'm stuck.
I need to keep the connection alive while waiting for a specific time to execute a script.

A cheezy way of doing it is to open another procomm session run a keep alive script with a while loop containing
pause 300
sendkeystr "^M"

then go back to the procomm session connected to the remote system, launch my waituntil script.

again, kinda cheezy and if the keep alive sends a CR when the other script executes it will hose it up..

the remote system needs to have an input and response otherwise it will log the user out after 10 minutes.



 
Haven't had a chance to try the idea I gave, but did you? The reason I ask is the below comment from the waituntil discussion in the ASPECT help file, which makes me think the when quiet command should work even when the waituntil command is active:

Active when commands will continue to "fire" during the execution of the waituntil command.

I will try to look at this later but a bit busy at the moment.

 
Got it to work using 'when elapsed' since I'm always receiving data from the remote system.
thanks for the input!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top