From 69049b69c8ce3413404af85c52698a5fe87a3b8a Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 18 Aug 2010 07:37:29 +0000 Subject: 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 git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3283 74dad513-b988-da41-8d7b-12977e46ad98 --- tests/pjsua/inc_sip.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/pjsua/inc_sip.py b/tests/pjsua/inc_sip.py index 9797941f..f7e64816 100644 --- a/tests/pjsua/inc_sip.py +++ b/tests/pjsua/inc_sip.py @@ -165,10 +165,10 @@ class Dialog: msg = "" src_addr = None while time.time() < endtime: - readset = select([self.sock], [], [], timeout) + readset = select([self.sock], [], [], 1) if len(readset[0]) < 1 or not self.sock in readset[0]: if len(readset[0]) < 1: - print "select() timeout" + print "select() timeout (will wait for " + str(int(endtime - time.time())) + "more secs)" elif not self.sock in readset[0]: print "select() alien socket" else: @@ -176,6 +176,7 @@ class Dialog: continue try: msg, src_addr = self.sock.recvfrom(4096) + break except: print "recv() exception: ", sys.exc_info()[0] continue -- cgit v1.2.3