# Q-11 MCS 275 Thu 6 Apr 2017 : quiz11b_client.py
"""
This is the corresponding client script,
corresponding to the script quiz11b_server.py.
"""
from socket import socket as Socket
from socket import AF_INET, SOCK_STREAM

HOSTNAME = 'localhost'  # on same host
PORTNUMBER = 12345      # same port number
BUFFER = 80             # size of the buffer

SERVER = (HOSTNAME, PORTNUMBER)
CLIENT = Socket(AF_INET, SOCK_STREAM)
CLIENT.connect(SERVER)
print('client sends 3.14')
CLIENT.send('3.14'.encode())
DATA = CLIENT.recv(BUFFER).decode()
print('client received', DATA)
CLIENT.close()
