#!/usr/bin/python
import socket
mySock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
mySock.bind((socket.gethostname(), 31535))
mySock.listen(5)
nicemessage = "Hi, nice to meet you!\n"
meanmessage = "You did not say hello, die in a fire\n"
while(1):
(clientsocket, address) = mySock.accept()
data = clientsocket.recv(100)
if data == "hello\r\n":
clientsocket.send(nicemessage)
else:
clientsocket.send(meanmessage)
clientsocket.close()