Summary
In this chapter, we reviewed using the socket module for implementing client-server architectures in Python with the TCP and UDP protocols. First, we reviewed the socket module for implementing a client and the main methods for resolving IP addresses from domains, including exception management. We continued to implement practical use cases, such as port scanning and a client-server application with message passing using TCP and UDP protocols. Finally, we implemented our own client-server application in a secure way using SSL sockets.
The main advantage provided by sockets is they maintain the connection in real time, and we can send and receive data from one end of the connection to another. For example, we could create our own chat, that is, a client-server application that allows messages to be received and sent in real time.
In the next chapter, we will explore HTTP request packages for working with Python, executing requests over a REST API, and authentication...