Changeset 8e166ae for protocols/skype
- Timestamp:
- 2013-02-11T12:56:04Z (12 years ago)
- Branches:
- master
- Children:
- 5a4f22e
- Parents:
- 5a0ffa2
- git-author:
- Mike Kazantsev <mk.fraggod@…> (11-02-13 12:56:04)
- git-committer:
- Miklos Vajna <vmiklos@…> (11-02-13 12:56:04)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/skype/skyped.py
r5a0ffa2 r8e166ae 124 124 return True 125 125 126 def send(sock, txt): 127 global options 128 from time import sleep 129 count = 1 130 done = False 126 def send(sock, txt, tries=10): 127 global options 131 128 if hasgobject: 132 while (not done) and (count < 10):129 for attempt in xrange(1, tries+1): 133 130 try: 134 sock.send(txt) 135 done = True 131 sock.sendall(txt) 136 132 except Exception, s: 137 count += 1 138 dprint("Warning, sending '%s' failed (%s). count=%d" % (txt, s, count)) 139 sleep(1) 140 if not done: 133 dprint("Warning, sending '%s' failed (%s). count=%d" % (txt, s, attempt)) 134 time.sleep(1) 135 else: 136 break 137 else: 141 138 options.conn.close() 142 139 else: 143 while (not done) and (count < 10) and options.conn: 140 for attempt in xrange(1, tries+1): 141 if not options.conn: break 144 142 if wait_for_lock(options.lock, 3, 10, "socket send"): 145 143 try: 146 if options.conn: sock.send (txt)144 if options.conn: sock.sendall(txt) 147 145 options.lock.release() 148 done = True149 146 except Exception, s: 150 147 options.lock.release() 151 count += 1152 148 dprint("Warning, sending '%s' failed (%s). count=%d" % (txt, s, count)) 153 sleep(1) 154 if not done: 149 time.sleep(1) 150 else: 151 break 152 else: 155 153 if options.conn: 156 154 options.conn.close()
Note: See TracChangeset
for help on using the changeset viewer.