made Client.setSocketChannel more safe