public Object getOption(SocketOption name) throws IOException {
if (!(name instanceof StandardSocketOption)) {
throw new IllegalArgumentException("Unsupported option " + name);
}
StandardSocketOption stdOpt = (StandardSocketOption) name;
final Socket socket = channel.socket();
try {
switch (stdOpt) {
case SO_SNDBUF:
return socket.getSendBufferSize();