Getting Started with Python (twenty-three) - socket network communications of the review

1. Communication network of three elements:

  • A: IP address:
    (1) to identify a separate host on the network
    (2) IP address = address + host address network
    (3) special address: 127.0.0.1 represent the address (typically used for testing)
  • B: Port number:
    (1) the logical address used to identify the process
    (2) different processes have different logical addresses
  • C: Transfer Protocol:
    (1) Rules of communication: TCP, UDP
    (2) TCP protocol through the three-way handshake, reliable transmission, but inefficient, slow
    (3) UDP direct throw in the past, regardless of whether the other there is a corresponding transfer rate high , low reliability, generally used for video, voice calls

2. Use sock module

Guess you like

Origin blog.csdn.net/HMMorange/article/details/104736514