March 2019
Beginner
490 pages
12h 40m
English
In the client part, we create a new socket that is listening in the same server host and port:
# Configure the data to connect to the server# socket.AF_INET6 to indicate that we will use Ipv6# socket.SOCK_STREAM to use TCP/IP# These protocols must be the same as on the serverclient = socket.socket (socket.AF_INET6, socket.SOCK_STREAM)client.connect ((host, port))print ("Connected to the server --->% s:% s"% (host, port))
Our socket is already created for sending data to the server:
#send initial data to servermessage = "Hello from ipv6 client"print ("Send data to server: %s" %message)client.send(bytes(message.encode('utf-8')))
And finally we indicate what we want to do with the connection. In this case, we will also do it ...
Read now
Unlock full access