def _eventlet_serve(sock, handle, concurrency):
 pool = eventlet.greenpool.GreenPool(concurrency)
 server_gt = eventlet.greenthread.getcurrent()
 while True:
  try:
   (conn, addr) = sock.accept()
   gt = pool.spawn(handle, conn, addr)
   gt.link(_eventlet_stop, server_gt, conn)
   (conn, addr, gt) = (None, None, None)
  except eventlet.StopServe:
   sock.close()
   pool.waitall()
   return

def _eventlet_serve ( sock , handle , concurrency ) : pool = eventlet . greenpool . GreenPool ( concurrency ) server_gt = eventlet . greenthread . getcurrent ( ) while True : try : ( conn , addr ) = sock . accept ( ) gt = pool . spawn ( handle , conn , addr ) gt . link ( _eventlet_stop , server_gt , conn ) ( conn , addr , gt ) = ( None , None , None ) except eventlet . StopServe : sock . close ( ) pool . waitall ( ) return
serve requests forever .