Now asyncore runs in its own thread. The code is much more efficient now.