Socket types

Currently, there are several types of sockets, and each one is usually associated with a type of protocol, for example:

Sockets can also be classified according to their family. We have Unix sockets, socket.AF_UNIX, which were created before the concept of networks and are based on files, socket.AF_INET for the IPv4 protocol, and socket.AF_INET6 for working with IPv6.