public <T> T getOption(final ChannelOption<T> option) throws UnsupportedOptionException, IOException {
if (option == null) {
throw new NullPointerException("name is null");
}
if (! OPTIONS.contains(option)) {
throw new UnsupportedOptionException("Option not supported: " + option);
}
if (CommonOptions.CLOSE_ABORT.equals(option)) {
return (T) Boolean.valueOf(socket.getSoLinger() != -1);
} else {
throw new UnsupportedOptionException("Option " + option + " not supported");
}
}