¹¦ÄÜ£ºÉèÖÿͻ§¶ËÁ´½ÓÊôÐÔ£¬µ«ÊDZàÒëµÄʱºò·¢ÏÖûÓÐIPPROTO_TCP£¬¶øÇÒ ÌáʾError while seting the client socket£¬Òâ˼¾ÍËãºóÃæµÄÉèÖÃÒ²ÓдíÎó£¬ C/C++ code:
void set_client_opt(const int client_id) { int value=0; int time = SENDTIMEOUT; int flag = 1; struct linger linger_c;
if (client_id <=0) exit_fatal("Error client id while set the opt");
linger_c.l_onoff = 1; linger_c.l_linger = 0 ;
/*value += setsockopt(client_id,IPPROTO_TCP,TCP_NODELAY,(const char *)&flag,sizeof(int));*/ value += setsockopt(client_id,SOL_SOCKET,SO_LINGER,(const char *)&linger_c,sizeof(linger_c)); value += setsockopt(client_id,SOL_SOCKET,SO_SNDTIMEO,(const char *)&time,sizeof(time));
if (value < 0) /*exit_fatal("Error while seting the client socket");*/ printf("Error while seting the client socket\n"); else printf("Seting the client socket success \n"); }
ÔÚLINUX裏°²裝 CURL 時,³ö現ÈçÏÂ報錯 checking for SSL support in libcurl... no checking for curl_easy_perform in -lcurl... no configure: error: There is something ......