March 2019
Beginner
490 pages
12h 40m
English
For simplicity, our client will be a socket that connects to our server that was developed with Twisted.
You can find the following code in the socket_client.py file:
#!/usr/bin/env python3from socket import sockets = socket()s.connect(("127.0.0.1", 8080))while True: output_data = input("Enter message> ") if output_data: s.send(output_data.encode()) input_data = s.recv(1024) if input_data: print(input_data.decode("utf-8"))
In this section, we have analyzed how to create our own socket client for communicating with the Twisted server on port 8080.
Read now
Unlock full access