What is the function SOCK_STREAM?

I found out about sockets in Python and came up with

variable = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 

I understood the function of this socket.socket and socket.AF_INET , but I'm interested in learning about socket.SOCK_STREAM . What is its function?

+6
source share
3 answers

SOCK_STREAM means it is a TCP socket.

SOCK_DGRAM means it is a UDP socket.

They are used in 99% of cases. There are other possibilities, see https://docs.python.org/2/library/socket.html#socket.SOCK_STREAM (you will need to specify a value for each of them on Google).

+7
source

SOCK_STREAM is a constant indicating the type of socket (TCP), not SOCK_DGRAM (UDP).

+4
source

SOCK_STREAM means connection oriented TCP.

+1
source

All Articles