import socket
s = socket.socket()
s.connect(("localhost", 9999))
s.listen(5)
sc, addr = s.accept()
while True:
recibido = sc.recv(1024)
mensaje = raw_input("> ")
s.send(mensaje)
print(recibido)
if mensaje=="exit":
break
print "fin de conecxion"
s.close()