December 2000
Intermediate to advanced
816 pages
16h 57m
English
Now that you know all about client-server architecture, sockets, and networking, let us try to bring this concept to Python. The primary module we will be using in this section is the socket module. Found within this module is the socket() function, which is used to create socket objects. Sockets also have their own set of methods which enable socket-based network communication.
To create a socket, you must use the socket.socket() function, which has the general syntax:
socket (socket_family, socket_type, protocol=0)
The socket_family is either AF_UNIX or AF_INET, as explained earlier, and the socket_type is either SOCK_STREAM or SOCK_DGRAM, also explained earlier. The ...
Read now
Unlock full access