I'm new to C and socket programming, just a question on the socket function:
int socket(int domain, int type, int protocol);
for example, we can call:
clientfd = socket(AF_INET, SOCK_STREAM, 0);
where AF_INET indicates that we are using 32-bit IP addresses and SOCK_STREAM means " Provides sequenced, reliable, two-way, connection-based byte streams.", which is TCP I guess, so SOCK_STREAM already indicates TCP protocol, so why socket function still needs a third protocol parameter?