Mokus
Mokus

Reputation: 10400

Python tcp send receive functions

In python the recv is a blocking function or not? I'm learned in the Uni C and there the was blocking and non-blocking socket. So I just wan to ask weather in python the recv function is a blocking function or not.

Upvotes: 3

Views: 673

Answers (2)

Arlaharen
Arlaharen

Reputation: 3145

Sockets in Python are blocking by the default. This behavior can be changed with setblocking or settimeout.

Another good place to find information on this is the socket how-to, especially the section on non-blocking sockets.

Upvotes: 5

brandx
brandx

Reputation: 1053

The socket in Python is blocking by default, unless you change it.

Upvotes: 1

Related Questions