Ejemplo n.º 1
0
    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()
Ejemplo n.º 2
0
    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()
Ejemplo n.º 3
0
                    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()
Ejemplo n.º 4
0
                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()