Which socket type is generally used for connection-oriented TCP communication?
Options
-
A.
SOCK_DGRAM
-
B.
SOCK_STREAM
-
C.
SOCK_RAW
-
D.
SOCK_PACKET
-
E.
None of the above
Correct Answer (Detailed Explanation is Below)
B.
SOCK_STREAM
Detailed Explanation
Correct Answer: SOCK_STREAM.SOCK_STREAM provides a reliable, connection-oriented byte stream and is commonly used with TCP. SOCK_DGRAM is commonly used with UDP.