CodePudding user response:
SOCK_STREAM is based on the TCP, guaranteed (i.e., to guarantee correct delivery of data to each other) connection-oriented SOCKET, used for data transfer,SOCK_DGRAM is based on UDP, insecurity of message-oriented socket, more used to broadcast message on the Internet,
Original SOCK_RAW socket, the need to specify the IP datagram or agreement,