import socket, sys

HOST = 'localhost'
PORT = 8080

# 1) create socket :
mySocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# 2) send connexion request to server:
try:
    mySocket.connect((HOST, PORT))
except socket.error:
    print("connexion failed")
    sys.exit()

# 3)communicate with server :

msgServer = mySocket.recv(1024).decode("Utf8")
print("S>", msgServer)

while 1:
    #msgClient = input("C> ")
    #mySocket.send(msgClient.encode("Utf8"))
    msgServer = mySocket.recv(1024).decode("Utf8")
    print("S>", msgServer)
    #mySocket.send("new".encode("Utf8"))

# 4) close connexion :
print("Connexion ended.")
mySocket.close()
4c9006074e834a120c93850c09bdf649a79d534a
<mask token>

<mask token>
try:
    mySocket.connect((HOST, PORT))
except socket.error:
    print('connexion failed')
    sys.exit()
<mask token>
print('S>', msgServer)
while 1:
    msgServer = mySocket.recv(1024).decode('Utf8')
    print('S>', msgServer)
print('Connexion ended.')
mySocket.close()

<mask token>
HOST = 'localhost'
PORT = 8080
mySocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
    mySocket.connect((HOST, PORT))
except socket.error:
    print('connexion failed')
    sys.exit()
msgServer = mySocket.recv(1024).decode('Utf8')
print('S>', msgServer)
while 1:
    msgServer = mySocket.recv(1024).decode('Utf8')
    print('S>', msgServer)
print('Connexion ended.')
mySocket.close()

import socket, sys
HOST = 'localhost'
PORT = 8080
mySocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
    mySocket.connect((HOST, PORT))
except socket.error:
    print('connexion failed')
    sys.exit()
msgServer = mySocket.recv(1024).decode('Utf8')
print('S>', msgServer)
while 1:
    msgServer = mySocket.recv(1024).decode('Utf8')
    print('S>', msgServer)
print('Connexion ended.')
mySocket.close()

import socket, sys

HOST = 'localhost'
PORT = 8080

# 1) create socket :
mySocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# 2) send connexion request to server:
try:
    mySocket.connect((HOST, PORT))
except socket.error:
    print("connexion failed")
    sys.exit()

# 3)communicate with server :

msgServer = mySocket.recv(1024).decode("Utf8")
print("S>", msgServer)

while 1:
    #msgClient = input("C> ")
    #mySocket.send(msgClient.encode("Utf8"))
    msgServer = mySocket.recv(1024).decode("Utf8")
    print("S>", msgServer)
    #mySocket.send("new".encode("Utf8"))

# 4) close connexion :
print("Connexion ended.")
mySocket.close()