import socket

HOST = '127.0.0.1'
PORT = 4242

#The client (usually) only needs one socket. There are reasons to have more of course.
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((HOST,PORT))

client.send("Ahoy".encode('utf-8'))
print(client.recv(1024).decode('utf-8'))
1dbf75fdc3920d0e1c18a903c569422dc5ce36d3
<mask token>

<mask token>
client.connect((HOST, PORT))
client.send('Ahoy'.encode('utf-8'))
print(client.recv(1024).decode('utf-8'))

<mask token>
HOST = '127.0.0.1'
PORT = 4242
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((HOST, PORT))
client.send('Ahoy'.encode('utf-8'))
print(client.recv(1024).decode('utf-8'))

import socket
HOST = '127.0.0.1'
PORT = 4242
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((HOST, PORT))
client.send('Ahoy'.encode('utf-8'))
print(client.recv(1024).decode('utf-8'))

import socket

HOST = '127.0.0.1'
PORT = 4242

#The client (usually) only needs one socket. There are reasons to have more of course.
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((HOST,PORT))

client.send("Ahoy".encode('utf-8'))
print(client.recv(1024).decode('utf-8'))