daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Feb 20th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. signal(SIGALRM, timeouthandler);
  2. alarm(3);
  3. ...(connection to a server that may hang)...
  4.  
  5. alarm(0);
  6.  
  7. timeouthandler(){
  8. ...(connection to a server that may hang)...
  9. }
  10.    
  11. signal(SIGALRM, timeouthandler2);
  12. alarm(3);
  13. ...(log the time out)...
  14.  
  15. alarm(0);
  16.  
  17. timeouthandler2(){
  18. ...(log the time out)...
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top