refactoring
clear writeBuffer onConnectionClosed fix #10