Comments
The Internet-specific:
struct sockaddr_in {
short sin_family;
u_short sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
Posted by waqasahmad
The generic:
struct sockaddr {
u_short sa_family;
char sa_data[14];
};
sa_family
- specifies which address family is being used
- determines how the remaining 14 bytes are used
The Internet-specific:
struct sockaddr_in {
short sin_family;
u_short sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
sin_family = AF_INET
sin_port: port # (0-65535)
sin_addr: IP-address
sin_zero: unused
Posted by Fangzhou