3. If we know stream sockets make use of TCP, datagram sockets make use of UDP, and raw sockets use neither, then, why both type and protocol need to be specified in the socket() command?
We know that socket streams make use of TCP, datagram sockets make use of UDP and raw sockets neither. But there is not always one protocol for each type used as there could be more than one type of protocol we want to use a particular type of packet transfer.
Thus if want to use the default protocol for the type of packet which we are sending then we can specify 0 as the protocol otherwise we need to specify the protocol through which we want to send.
That was a nice
question to answer
Friend, If you have any doubts in understanding do let me know in
the comment section. I will be happy to help you further.
Thanks
Get Answers For Free
Most questions answered within 1 hours.