Because we're using asyncore too here, we have a few problems with the timeouts. I think we are closing the socket being used by asyncore, resulting in this error:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 390, in run
    result = self._run(*self.args, **self.kwargs)
  File "/home/czardoz/git/beeswarm/hive/capabilities/smtp.py", line 184, in handle_session
    asyncore.loop()
  File "/usr/lib/python2.7/asyncore.py", line 216, in loop
    poll_fun(timeout, map)
  File "/usr/lib/python2.7/asyncore.py", line 145, in poll
    r, w, e = select.select(r, w, e, timeout)
  File "/usr/local/lib/python2.7/dist-packages/gevent/select.py", line 62, in select
    raise error(*ex.args)
error: (2, 'No such file or directory')
<Greenlet at 0x9ae670c: <bound method smtp.handle_session of <hive.capabilities.smtp.smtp object at 0x9af122c>>(<HiveSocket at 0x9af576c fileno=17 sock=127.0.0.1:, ('127.0.0.1', 50158))> failed with error

I can't really figure out how to get past this one... the only way seems to be to do away from asyncore totally, but the standard library uses it for the base classes