struct sockaddr_in structure

This structure references the socket's elements that are used for keeping addresses. The following are the built-in members of this structure:

struct sockaddr_in {
short int sin_family;
unsigned short int sin_port;
struct in_addr sin_addr;
unsigned char sin_zero[8];
};

Here, we have the following:

struct in_addr comprise one member, as follows:


struct in_addr {
unsigned long s_addr;
};

Here, s_addr is used to represent the address in network byte order.