Properly close socketChannelFactory on shutdown