(i) Client/server architecture
1. What is the client/server used for?
The client makes a request to the server, and the server receives the request to service the client.
Server has two forms, a software server pattern, such as (Web server), the client sends the request to the server, the server receives the request, provides the information on the webpage for its service.
Another is the hardware server form, such as (printer, USB stick), to provide services to the client.
Both the client and the server, more special such as (bank ATM, computer) to provide hardware services (input, output, spit money), and send a request to the software server.
2. How the server communicates with the client
The server first creates a communication endpoint and listens for requests. Each server should (only) one communication endpoint.
(ii) network programming based on Python
1. Sockets are network data structures for communication endpoint concepts. (Socket set up and wait indefinitely)
2. Socket three-form Af_unix Af_netlink Af_inte used most of the time Af_inte
3. For a connection socket, specify a socket type by using the TCP connection Word to find the host by IP. (Server sockets and host sockets)
4. No connection UDP and IP
Create a UDP socket connection code implementation to receive two host communications
TCP implements a connection between two hosts
The above code comes from Cao Deqing's network Programming Soket () module programming
Python Network Programming (11)