def run(self): while True: try: msg = raw_input() #get user input msgsquence = msg.strip().split(':') #strip the input and explode the string by ":" #print msgsquence msgsquence2 = msgsquence[0].strip().split('/'); host = string.join(msgsquence2[1], '') msg = msgsquence[1:] msg = string.join(msg, ':') protocol.sendmsg(self.client_socket, host, msg) protocol.printhost() print ">" except EOFError: protocol.logout() print "byte byte" os.abort() s.close()
def run(self): while True: try: msg = raw_input() #get user input msgsquence = msg.strip().split( ':') #strip the input and explode the string by ":" #print msgsquence msgsquence2 = msgsquence[0].strip().split('/') host = string.join(msgsquence2[1], '') msg = msgsquence[1:] msg = string.join(msg, ':') protocol.sendmsg(self.client_socket, host, msg) protocol.printhost() print ">" except EOFError: protocol.logout() print "byte byte" os.abort() s.close()
protocol.optresp(protocol.commandword['IPMSG_BR_ENTRY'], remotehost) protocol.sendansentry(client_socket, remotehost) elif commandword == protocol.commandword['IPMSG_ANSENTRY']: remotehost = addr protocol.optresp(protocol.commandword['IPMSG_ANSENTRY'], remotehost) else: print "Notice > Uncatched message :", strlist, ":", commandword print ">" protocol.printhost() except socket.timeout: pass s.close() tc = clientthread(client_socket, server_socket) ts = serverthread(client_socket, server_socket) ts.start() tc.start() while True: try: time.sleep(1) except EOFError: protocol.logout() print "byte! byte!" os.abort()
elif commandword == protocol.commandword['IPMSG_BR_ENTRY'] : remotehost = addr protocol.optresp(protocol.commandword['IPMSG_BR_ENTRY'], remotehost) protocol.sendansentry(client_socket, remotehost) elif commandword == protocol.commandword['IPMSG_ANSENTRY'] : remotehost = addr protocol.optresp(protocol.commandword['IPMSG_ANSENTRY'], remotehost) else : print "Notice > Uncatched message :",strlist, ":" , commandword print ">" protocol.printhost() except socket.timeout: pass s.close() tc = clientthread(client_socket, server_socket) ts = serverthread(client_socket, server_socket) ts.start() tc.start() while True: try: time.sleep(1) except EOFError: protocol.logout() print "byte! byte!" os.abort()