getsockopt()/setsockopt() //获得sockfd指向的socket的属性 int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); //设置sockfd指向的socket的属性,成功返回0,失败返回-1设errno. int setsockopt(int sockfd, int level, int optname, const void *optval, so…