Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- signal(SIGALRM, timeouthandler);
- alarm(3);
- ...(connection to a server that may hang)...
- alarm(0);
- timeouthandler(){
- ...(connection to a server that may hang)...
- }
- signal(SIGALRM, timeouthandler2);
- alarm(3);
- ...(log the time out)...
- alarm(0);
- timeouthandler2(){
- ...(log the time out)...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement