Changeset 3283 for pjproject/trunk


Ignore:
Timestamp:
Aug 18, 2010 7:37:29 AM (14 years ago)
Author:
bennylp
Message:

Misc (re #1110): fixed bug in the python unit test that caused tests to run for much longer than needed because it unnecessarily waits for incoming message until timeout occurs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/tests/pjsua/inc_sip.py

    r3252 r3283  
    166166                src_addr = None 
    167167                while time.time() < endtime: 
    168                         readset = select([self.sock], [], [], timeout) 
     168                        readset = select([self.sock], [], [], 1) 
    169169                        if len(readset[0]) < 1 or not self.sock in readset[0]: 
    170170                                if len(readset[0]) < 1: 
    171                                         print "select() timeout" 
     171                                        print "select() timeout (will wait for " + str(int(endtime - time.time())) + "more secs)" 
    172172                                elif not self.sock in readset[0]: 
    173173                                        print "select() alien socket" 
     
    177177                        try: 
    178178                                msg, src_addr = self.sock.recvfrom(4096) 
     179                                break 
    179180                        except: 
    180181                                print "recv() exception: ", sys.exc_info()[0] 
Note: See TracChangeset for help on using the changeset viewer.