struct sockaddr_in { __SOCKADDR_COMMON (sin_); in_port_t sin_port; //端口号 struct in_addr sin_addr; //IP地址 unsigned char sin_zero[sizeof (struct sockaddr) - __SOCKADDR_COMMON_SIZE - sizeof (in_port_t) - sizeof (struct in_addr)]; //使与sockaddr长度一致 }; 上面这个结构体是Linux in.h头文件中定义的,那么开头的__SOCKADDR_COMMON (sin_);
繁花不似锦
紫衣仙女