---restore content starts---
0x01 Socket First Family Af_unix
Address family: Addresses Family:unix file-based sockets
Type II Af_inet
Address family: Internet
Type III: Af_netlink (no connection type)
Allows the use of the BSD socket user interface for IPC between user-level and kernel-level code.
0X02 connection-oriented sockets and non-connected sockets
(1). Connection-oriented sockets.
Communication provides serialization, reliable, and non-repeatable data delivery. Information can be split into multiple fragments, and each socket is guaranteed to reach its destination. Implement this type of primary protocol: TCP.
(2). For non-connected sockets
Contrary to the nature of the connection-oriented sockets. Low cost. Udp.
0X03 socket () module function
Sockets (Socket_family, Socket_type, protocol=0)
Create a TCP/IP socket
Tcpsock = Socket.socket (socket.af_inet, socket. SOCK_STREAM)
Create UDP/IP sockets
Udpsock = Socket.socket (socket.af_inet, socket. SOCK_STREAM)
Using the FROM socket import * allows you to introduce the socket attribute into the namespace, which shortens the code.
Tcosock = socket (af_inet, SOCK_STREAM)
---restore content ends---
Python Core (i)