[issue10878] asyncore does not react properly on close()

2011-05-31 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: -Python 2.5, Python 2.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue10878] asyncore does not react properly on close()

2011-01-09 Thread Teodor Georgiev
New submission from Teodor Georgiev : I am trying to add a simple timer to each created socket and destroy it once the timer expires: class client(asyncore.dispatcher): def __init__(self,host): ... self.timeout = time.time() + 5 def readable(self): if time.time() >= self

[issue10878] asyncore does not react properly on close()

2011-01-09 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Problem is you have to return False right after close(). There's an open issue to add a scheduler to asyncore: http://bugs.python.org/issue1641 Closing this out as invalid. -- nosy: +giampaolo.rodola resolution: -> invalid status: open -> closed __

[issue10878] asyncore does not react properly on close()

2011-01-10 Thread Teodor Georgiev
Teodor Georgiev added the comment: Sorry, I forgot to mention - I have already tried to return False, but there was no difference. def readable(self): if time.time() >= self.timeout: self.close() return False else: return True -- re

[issue10878] asyncore does not react properly on close()

2011-01-10 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: What if you return False also in writable method? -- ___ Python tracker ___ ___ Python-bugs-list

[issue10878] asyncore does not react properly on close()

2011-01-10 Thread Teodor Georgiev
Teodor Georgiev added the comment: Precisely, I traced down the problem by putting a simple "breakpoint" in asyncore.py: def poll(timeout=0.0, map=None): if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): is_r

[issue10878] asyncore does not react properly on close()

2011-01-26 Thread gmr
gmr added the comment: What I noticed in tracing through the code is that it's getting stuck in a loop because it depends on grabbing asyncore.socket_map if map is null when passed into asyncore.loop. I got around this by appending: asyncore.loop(0.1, map=[], count=1) After my close(). I bel

[issue10878] asyncore does not react properly on close()

2011-01-26 Thread gmr
gmr added the comment: For more clarity, I am passing in a list because it will evaluate as False in the while loop on 209 and 213. The fix is to add len(map) to the while loops on those lines. -- ___ Python tracker

[issue10878] asyncore does not react properly on close()

2013-03-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: Teodor or Gavin: is the (mis)behavior the same in 3.3? Giampaolo: has the OP identified a fixable misbehavior relative to the documented behavior, making this a valid behavior issue? Or is this instead an enhancement request, possibly superseded by #1641?

[issue10878] asyncore does not react properly on close()

2013-03-08 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I'm not sure what the OP and Gavin are complaining about in their last messages. Could you guys be more clear and/or provide a code sample which reproduces the problem? -- ___ Python tracker