August 2011
Intermediate to advanced
552 pages
23h 48m
English
There are a number of data structures used to represent network addresses, along with a number of functions for converting addresses between different formats.
The fundamental data structure in the sockets API is struct sockaddr:
struct sockaddr {
uint8_t sa_len;
sa_family_t sa_family;
char sa_data[14];
};
struct sockaddr acts like an abstract base class in object-oriented languages. It defines two fields that are common amongst all of the different address types. By examining these fields you can see how large the address structure is by looking at sa_len, and you can see what kind of address it ...
Read now
Unlock full access