unregistered event should go before close, TODO fix connect method in NioDatagramChannel