Understanding struct sockaddr
The format and size of the address is usually protocol specific. sockaddr is used as the base of a set of address structures that act like a discriminated union, see the Beej guide to networking. You generally look at the sa_family and then cast to the appropriate address family’s specific address structure. TCP and UDP … Read more