Here's what I was looking at:
http://beej.us/guide/bgnet/output/html/ ... sdata.html
This:
is one thing I don't understand. An int called ai_flags, OK, I get that, and a char called sockaddr, that too, but why am I being shown this? Something just occurred to me which may answer my question: this is probably just like a class library, only with structs, correct? If I need to use one of these members, I can just access them, right? That seems to fit with the rest of the tutorial.struct addrinfo {
int ai_flags; // AI_PASSIVE, AI_CANONNAME, etc.
int ai_family; // AF_INET, AF_INET6, AF_UNSPEC
int ai_socktype; // SOCK_STREAM, SOCK_DGRAM
int ai_protocol; // use 0 for "any"
size_t ai_addrlen; // size of ai_addr in bytes
struct sockaddr *ai_addr; // struct sockaddr_in or _in6
char *ai_canonname; // full canonical hostname
struct addrinfo *ai_next; // linked list, next node
};
Also, what's the difference between Socket programming, and using a networking library?