Differences between makefile () and send () recv () Python

What is the use of makefile () when working with Python Sockets?

I can get the program to work with send () and recv () functions in Python. But I read that it is better to use the makefile () method to buffer the data. I did not understand this relationship and the differences ... any help?

Tks!

+3
source share
1 answer

You can use makefileit if you find the user-friendly Python interface. For example, you can use methods such as readlinesin a socket (you will have to implement it manually when using recv). This may be more convenient when sending text data to a socket, but YMMV.

+3
source

All Articles