question: public final void close ( LsServerPacket closePacket , boolean forced ) { synchronized ( guard ) { if ( isWriteDisabled ( ) ) { return ; } log . debug ( "sending packet: " + closePacket + " and closing connection after that." ) ; pendingClose = true ; isForcedClosing = forced ; sendMsgQueue . clear ( ) ; sendMsgQueue . addLast ( closePacket ) ; enableWriteInterest ( ) ; } }
target:  Its guaranted that closePacket will be sent before closing connection, but all past and future packets wont. Connection will be closed [by Dispatcher Thread], and onDisconnect() method will be called to clear all other things. forced means that server shouldn't wait with removing this connection.