Esempio n. 1
0
    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()
Esempio n. 2
0
    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()
Esempio n. 3
0
    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()
Esempio n. 4
0
 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()
Esempio n. 5
0
 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()
Esempio n. 6
0
 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)
Esempio n. 7
0
 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)