# L-20.0 MCS 260 Fri 1 Aug 2014 : tcp_client.py
"""
Illustration of sockets in a client using TCP.
The behavior of the corresponding server is
defined in the script tcp_server.py.
"""
from socket import socket as Socket
from socket import AF_INET, SOCK_STREAM

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

SERVER_ADDRESS = (HOSTNAME, NUMBER)
CLIENT = Socket(AF_INET, SOCK_STREAM)
CLIENT.connect(SERVER_ADDRESS)

print 'client is connected'
DATA = raw_input('Give message : ')
CLIENT.send(DATA)

CLIENT.close()
