Socket (Python Std.Lib.)
Introduction
The Python interface is a straightforward transliteration of the Unix system call and library interface for sockets to Python’s object-oriented style: the
socket()
function returns a socket object whose methods implement the various socket system calls. Parameter types are somewhat higher-level than in the C interface: as withread()
andwrite()
operations on Python files, buffer allocation on receive operations is automatic, and buffer length is implicit on send operations.