simulacre/em-ssh — pull request #7 by darkskiez (2012-04-25 15:22:55+00:00)
Title: Fixes #4 - wait_for consumes too much data 

This is my fix for this, I'm not sure my use of the callbacks is quite within keeping of your style, so please review this closely.

On rare occasion Ive seen the data_callback invoked twice somehow, maybe a combination of my manual trigger which checks the current buffer..

I started receiving timeouts when maintaining ~70 ssh connections concurrently with EM, I have tested again with this patch and got upto ~1024 stable sshs before something blows up on me, I've increased my file descriptor limit, but to no avail.