设置定时器(timer), 捕捉SIGALRM信号
void handler(int signo){return;}struct sigaction act;sigaction(SIGALRM, NULL, &act);act.sa_handler = handler;act.sa_flags &= ~SA_RESTART;//清除掉SIGALRM信号的SA_RESTARTsigaction(SIGALRM, &act, NULL);alarm(5);if (recv(,,,) < 0) ……
