put back select() calls in gevent read/write loops
properly drain pending data on SSL socket in the gevent reactor