March 2019
Beginner
490 pages
12h 40m
English
First, we need to run the server with the following command:
$ python twisted_basic_server.py
At this moment, the server is waiting for connections from the client. If we run the client, we can write any message in the console and you will see how the server responds with what it has received. The following could be the messages that the server receives from two connected clients:
Client connection from: ('127.0.0.1', 8229) Message sent by the client: hi this is my message Message sent by the client: Message from client 1 Client connection from: ('127.0.0.1', 8282) Message sent by the client: Message from client 2 Client disconnected from: ('127.0.0.1', 8282) Client disconnected from: ('127.0.0.1', 8229)
Read now
Unlock full access