import socket
host '127.0.0.1'
port = 2022
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
message="Hey Server!!! What will we do in today's lab???"
while True:
s.send(message.encode('utf-8'))
data = s.recv(1024)
print('Received from the server', str(data.decode('utf-8'))) reply input('\nDo you want to continue (y/n) :')
if reply == 'y':
continue
else:
print("Bye Server")
break
s.close()
|