?????????????? pthread_join ???? pthread_cancel ??????????????????????????????????????? service ?????????????????????β?????????? recvfrom ?????????

??????????????£??????????? shutdown ??????

    //shutdown?????????? 
    #include <sys/socket.h> 
    int shutdown(int s?? int how); 
     
    //shutdown() ???????????????и???μ???????????????????е?????????????? 
    //???? s ???????????????????? 
    //???? how ????????????????????£? 
    //SHUT_RD : ???????????????????????????????????κ????????????????л?δ????????????????????????????????????????????????? 
    //SHUT_WR : ?????????д????????????????????????κ????????????????л?δ????????????????????????????????????????????????? 
    //SHUT_RDWR : ????д????????????? 
    //??г?????? 0?????????? -1???????????? errno ?С?

?????????????£????????????????pthread_join?????????shutdown(fd??SHUT_RDWR); ??????????????????£?

?????????????Service????????????????????????????????????shutdownд????????shutdown????????

??????????????????????????д??? shutdown(fd??SHUT_WR)????????????????????????????????????? shutdown(fd??SHUT_RD)???????????????????????????£????recvfrom??fd??????????б??У???????????????????recvfrom?????????

???????????shutdown???????recvfrom???????????close????????

?????????????£?shutdown?????socket??????д??????????д??????socket?????????????close????????????????????socket???????????????н??ж?д????????????????????????????д?????????????????????????????ε?????

??????????????????????????????????????????У?

???????????????????????????????е??Щ?????????????????????о???

????1??????socket????/??????

????2????÷????????????socket???

????3????????????????????

????????д????????????????????