工作中用到的別人的測(cè)試代碼,代碼當(dāng)然自己也可以寫(xiě),看懂了,然后按照自己的需求來(lái)改,效率更高
1. ??Linux 線程同步的三種方法 -幸運(yùn)啤酒蓋-ChinaUnix博客
2.?pthread_getspecific()–讀線程私有數(shù)據(jù)
3. ?linux?poll例子_manyhappyreturn_新浪博客? ? ? ? --- ??poll 的例子 - zqt520的專(zhuān)欄 - 博客頻道 - CSDN.NET
4. 網(wǎng)絡(luò)編程api ?beej-zhtw.netdpi.net/09-man-manual/9-17-poll? /?beej-zhcn.netdpi.net/05-system-call-or-bust/5-7-send
5.?C: Linux Socket Programming
6.?Github上的600多個(gè)iOS開(kāi)源類(lèi)庫(kù) / 藍(lán)訊
7. fork ?fork/fork.c at master · luisbajana/fork · GitHub
8.?libcurl - source code examples
9.?linux設(shè)置套接字緩沖區(qū)的大小 - liangxanhai的專(zhuān)欄 - 博客頻道 - CSDN.NET? ? setsockopt getsockopt
? ??c - SO_SNDBUF and SO_RCVBUF on Linux sockets - Stack Overflow
? ??c - Understanding set/getsockopt SO_SNDBUF - Stack Overflow
10. ?stackoverflow.com/questions/4181784/how-to-set-socket-timeout-in-c-when-making-multiple-connections
structtimeval timeout;timeout.tv_sec=10;timeout.tv_usec=0;if(setsockopt(sockfd,SOL_SOCKET,SO_RCVTIMEO,(char*)&timeout,sizeof(timeout))<0)error("setsockopt failed\n");if(setsockopt(sockfd,SOL_SOCKET,SO_SNDTIMEO,(char*)&timeout,sizeof(timeout))<0)error("setsockopt failed\n");