1.sockaddr结构体
struct sockaddr{ unsigned short sa_family; //地址类型,AF_XXX char sa_data[14]; //14字节的端口和地址 }
2.sockaddr_in结构体
struct sockaddr_in{ short int sin_family; //地址类型 unsigned short int sin_port; //端口号 struct in_addr sin_addr; //地址 unsigned char sin_zero[8]; //为了保持与struct 的长度sockaddr一样的长度 }
3.in_addr结构体
struct addr_in{ unsigned long s_addr; //地址 }