We start the server with the echo_server_ipv6.py Python command and wait for a connection:
usage: echo_server_ipv6.py [-h] --port PORT
We must pass the port for listening connections as an argument:
$ python echo_server_ipv6.py --port 7575
Waiting connections in ::1:7575
Next, we start the client with the same port parameter:
$ python echo_client_ipv6.py --port 7575
Connected to the server --->::1:7575
Send data to server: Hello from ipv6 client
Received initial message from server: Hello from ipv6 client
We will see that the server has already found the connection:
Connected to ('::1', 5223, 0, 0)
Received data from the client: [Hello from ipv6 client]
Sent data echoed back to the client: [Hello from ipv6 client]
Now we can write any message and command on the client, and in the server log we can verify that the message was sent and that the command was executed.
In the following screenshot, we can see the execution in the socket server:
In the following screenshot, we can see the execution in the socket client and the output when sending messages and commands:
We analyzed the implementation of a client-server application with an IPv6 protocol for sending messages and commands and the execution of them on the server.