示例#1
0
 def __init__(self, threadID, name, event, shared):
     threading.Thread.__init__(self)
     self.threadID = threadID
     self.name = name
     self.shared = shared
     self.receive = PingListener(shared)
     logging.basicConfig(
         filename='fastPing.log',
         level=logging.DEBUG,
         format='%(asctime)s %(message)s',
         datefmt='%d/%m/%Y %I:%M:%S %p'
     )  #credo si possa passare come argomento a tutti e 3
     self.event = event
示例#2
0
 def __init__(self, threadID, name,event,shared):
     threading.Thread.__init__(self)
     self.threadID = threadID
     self.name = name
     self.shared=shared
     self.receive=PingListener(shared)
     self.event=event   
示例#3
0
 def __init__(self, threadID, name,event,shared):
     threading.Thread.__init__(self)
     self.threadID = threadID
     self.name = name
     self.shared=shared
     self.receive=PingListener(shared)
     logging.basicConfig(filename='fastPing.log',level=logging.DEBUG, format='%(asctime)s %(message)s', datefmt='%d/%m/%Y %I:%M:%S %p')#credo si possa passare come argomento a tutti e 3
     self.event=event   
示例#4
0
class ThreadReceiver(threading.Thread):
    #id, name, sharedVariable, lock
    def __init__(self, threadID, name, event, shared):
        threading.Thread.__init__(self)
        self.threadID = threadID
        self.name = name
        self.shared = shared
        self.receive = PingListener(shared)
        logging.basicConfig(
            filename='fastPing.log',
            level=logging.DEBUG,
            format='%(asctime)s %(message)s',
            datefmt='%d/%m/%Y %I:%M:%S %p'
        )  #credo si possa passare come argomento a tutti e 3
        self.event = event

    def run(self):
        print "Starting " + self.name
        self.receive.initialize()
        self.shared.check_killed("Receiver", self.event)
        self.receive.state_sync()
        self.shared.check_killed("Receiver", self.event)
        while not self.shared.finishCycle:
            self.receive.state_listen()
            #print time.time()-a
            self.shared.check_killed("Receiver", self.event)
        print "Receiver: Finished"
示例#5
0
class ThreadReceiver (threading.Thread):
    #id, name, sharedVariable, lock
    def __init__(self, threadID, name,event,shared):
        threading.Thread.__init__(self)
        self.threadID = threadID
        self.name = name
        self.shared=shared
        self.receive=PingListener(shared)
        self.event=event   



    def run(self):
        print "Starting " + self.name
        self.receive.initialize()
        self.shared.check_killed("Receiver",self.event)     
        self.receive.state_sync()
        self.shared.check_killed("Receiver",self.event)      
        while  not self.shared.finishCycle:                   
            self.receive.state_listen()  
            #print time.time()-a            
            self.shared.check_killed("Receiver",self.event)           
        print "Receiver: Finished"
示例#6
0
class ThreadReceiver (threading.Thread):
    #id, name, sharedVariable, lock
    def __init__(self, threadID, name,event,shared):
        threading.Thread.__init__(self)
        self.threadID = threadID
        self.name = name
        self.shared=shared
        self.receive=PingListener(shared)
        logging.basicConfig(filename='fastPing.log',level=logging.DEBUG, format='%(asctime)s %(message)s', datefmt='%d/%m/%Y %I:%M:%S %p')#credo si possa passare come argomento a tutti e 3
        self.event=event   



    def run(self):
        print "Starting " + self.name
        self.receive.initialize()
        self.shared.check_killed("Receiver",self.event)     
        self.receive.state_sync()
        self.shared.check_killed("Receiver",self.event)      
        while  not self.shared.finishCycle:                   
            self.receive.state_listen()  
            #print time.time()-a            
            self.shared.check_killed("Receiver",self.event)           
        print "Receiver: Finished"