'Send the stop message to the agent process'

def stopAgentProcess(self):

    try:
        self.lock.acquire()
        if ((self.agent is None) or (self.agent.poll() is not None)):
            return
        self.agent.stdin.write('seeya\n')
        self.agent.stdin.flush()
        time.sleep(1)
        self.agent = None
    finally:
        self.lock.release()
