Moving drainBuffer() call to execute after socket is closed
Merge pull request #3 from appglu/master

Moving drainBuffer() call to execute after socket is closed