March 2019
Beginner
490 pages
12h 40m
English
At the time of making a server using the Python socket libraries, a loop was implemented that is in charge of verifying the new connections. We will manage the event handlers with Twisted.
We can manage events for many situations, such as a new connection by a client, the reception of data, or whether a client has been disconnected. These event handlers are defined in a protocol, and this protocol needs a Factory that can build the objects of the events. This may sound confusing, but the code will make everything clearer.
In the following example, we are going to write a basic server using the Twisted framework. You can find the following code in the twisted_basic_server.py file:
#!/usr/bin/python3from twisted.internet ...
Read now
Unlock full access