codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  How to time out an operation?  mimir at 16:31 on Saturday, March 22, 2008
 

#Im trying to time out an operation...

#the books say it should be done with the following method:

$SIG{ALRM} = sub { die "Timeout" };
eval
{
alarm 3;
chomp($answer = <STDIN>);
alarm 0;
};




#####
but... in my system, when alarm 3 gets execute, the eval function is quitted.
so the timeout never takes place.

also... when i type alarm 3; into a script and its not inside eval{...} then i get an error.
the books claim one should not get an error and im not finding out why the error comes up.

How does one time out an operation?








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  TM symbol is not displayed correctly.
•  How to time out an operation?
•  Getting dat a from datagrid
•  Re: Java script: Disable
•  Re: file upload
•  get generated html of a webpage into my code
•  get generated html of a webpage into my code
•  Re: getting hash from a hash of hashes
•  decoding iframes


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008