分类: LINUX
2013-05-11 01:31:05
|
xiaosuo@gentux perl \$ ./a.out 10.16.101.1 90 1180289276 timeout 1180289279 xiaosuo@gentux perl \$ ./a.out 10.16.101.1 90 1 1180289281 timeout 1180289282 |
int error; getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &errorlen); |
559 timeo = sock_sndtimeo(sk, flags & O_NONBLOCK); 560 561 if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) { 562 /* Error code is set above */ 563 if (!timeo || !inet_wait_for_connect(sk, timeo)) 564 goto out; 565 566 err = sock_intr_errno(timeo); 567 if (signal_pending(current)) 568 goto out; 569 } |
|
xiaosuo@gentux perl \$ ./a.out 10.16.101.1 90 1180290583 timeout 1180290586 xiaosuo@gentux perl \$ ./a.out 10.16.101.1 90 2 1180290590 timeout 1180290592 |
和设想完全一致!
原文地址: