def run(self): # Initiate the connection to the server self.connection.connect((self.host, self.server_port)) while True: userInput = raw_input("") liste = [] if " " in userInput: content = "" liste = userInput.split(" ") request = liste[0] for i in range(1, len(liste)): content += liste[i] if (i != len(liste) - 1): content += " " else: request = userInput content = None self.send_payload(request, content) if request == "logout": self.disconnect() reciever = MessageReceiver(self, self.connection) reciever.daemon = True reciever.start()
def run(self): # Initiate the connection to the server self.connection.connect((self.host, self.server_port)) while True: userInput = raw_input("") liste = [] if " " in userInput: content = "" liste = userInput.split(" ") request = liste[0] for i in range(1, len(liste)): content += liste[i] if(i != len(liste)-1): content += " " else: request = userInput content = None self.send_payload(request, content) if request == "logout": self.disconnect() reciever = MessageReceiver(self, self.connection) reciever.daemon = True reciever.start()
def run(self): # Initiate the connection to the server s_thread = MessageReceiver(self, self.connection) s_thread.daemon = True s_thread.start() while self.active: self.get_input()
def run(self): # Initiate the connection to the server self.connection.connect((self.host, self.server_port)) # print "[*] Kobling etablert" listener = MessageReceiver(self, self.connection) listener.daemon = True listener.start() # print "[*] Lytter startet." self.handle_input()
def run(self): # Initiate the connection to the server self.connection.connect((self.host, self.server_port)) print "[*] Kobling etablert" lytter = MessageReceiver(self,self.connection) lytter.daemon = True lytter.start() print "[*] Lytter startet." self.handle_input()
def run(self): # Initiate the connection to the server self.connection.connect((self.host, self.server_port)) worker = MessageReceiver(self, self.connection) worker.daemon = True worker.start() running = True while running: raw = raw_input() if raw == "exit": running = False self.disconnect() else: self.send_payload(raw)