March 2019
Beginner
490 pages
12h 40m
English
First, we need to configure the data to connect to the server and send initial data to the server:
client = socket.socket (socket.AF_INET6, socket.SOCK_STREAM)client.connect ((host, port))message = "Hello from ipv6 client"print ("Send data to server: %s" %message)client.send(bytes(message.encode('utf-8')))data = client.recv(4096)print ('Received initial message from server:', data.decode())
Then, we will create a loop and use the send and recv methods from the socket client to transmit information from the client to the server. We use the exit message to close the connection between the client and server.
You can find the following code in the echo_client_ipv6.py file:
#!/usr/bin/env python3import argparseimport ...
Read now
Unlock full access