@Override public int getSendBufferSize() { try { return javaSocket.getSendBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public SocketChannelConfig setSendBufferSize(int sendBufferSize) { try { javaSocket.setSendBufferSize(sendBufferSize); } catch (SocketException e) { throw new ChannelException(e); } return this; }
@Override public SocketChannelConfig setTcpNoDelay(boolean tcpNoDelay) { try { javaSocket.setTcpNoDelay(tcpNoDelay); } catch (SocketException e) { throw new ChannelException(e); } return this; }
@Override public int getSoTimeout() { try { return javaSocket.getSoTimeout(); } catch (IOException e) { throw new ChannelException(e); } }
@Override public OioServerSocketChannelConfig setSoTimeout(int timeout) { try { javaSocket.setSoTimeout(timeout); } catch (IOException e) { throw new ChannelException(e); } return this; }
@Override public ServerSocketChannelConfig setReuseAddress(boolean reuseAddress) { try { javaSocket.setReuseAddress(reuseAddress); } catch (SocketException e) { throw new ChannelException(e); } return this; }
private void setOption0(Object option, Object value) { if (SET_OPTION == null) { throw new UnsupportedOperationException(); } else { try { SET_OPTION.invoke(javaChannel, option, value); } catch (Exception e) { throw new ChannelException(e); } } }
private Object getOption0(Object option) { if (GET_OPTION == null) { throw new UnsupportedOperationException(); } else { try { return GET_OPTION.invoke(javaChannel, option); } catch (Exception e) { throw new ChannelException(e); } } }
@Override public T newChannel() { try { return constructor.newInstance(); } catch (Throwable t) { throw new ChannelException("Unable to create Channel from class " + constructor.getDeclaringClass(), t); } }
@Override public OioDatagramChannelConfig setSoTimeout(int timeout) { try { javaSocket().setSoTimeout(timeout); } catch (IOException e) { throw new ChannelException(e); } return this; }
@Override public DatagramChannelConfig setInterface(InetAddress interfaceAddress) { try { setNetworkInterface(NetworkInterface.getByInetAddress(interfaceAddress)); } catch (SocketException e) { throw new ChannelException(e); } return this; }
@Override public boolean isBroadcast() { try { return javaSocket.getBroadcast(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public DatagramChannelConfig setTrafficClass(int trafficClass) { try { javaSocket.setTrafficClass(trafficClass); } catch (SocketException e) { throw new ChannelException(e); } return this; }
@Override public boolean isReuseAddress() { try { return javaSocket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public int getReceiveBufferSize() { try { return javaSocket.getReceiveBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public DatagramChannelConfig setSendBufferSize(int sendBufferSize) { try { javaSocket.setSendBufferSize(sendBufferSize); } catch (SocketException e) { throw new ChannelException(e); } return this; }
@Override public int getTimeToLive() { if (javaSocket instanceof MulticastSocket) { try { return ((MulticastSocket) javaSocket).getTimeToLive(); } catch (IOException e) { throw new ChannelException(e); } } else { throw new UnsupportedOperationException(); } }
@Override public InetAddress getInterface() { if (javaSocket instanceof MulticastSocket) { try { return ((MulticastSocket) javaSocket).getInterface(); } catch (SocketException e) { throw new ChannelException(e); } } else { throw new UnsupportedOperationException(); } }
@Override public DatagramChannelConfig setReuseAddress(boolean reuseAddress) { try { javaSocket.setReuseAddress(reuseAddress); } catch (SocketException e) { throw new ChannelException(e); } return this; }
@Override public int getSoTimeout() { try { return javaSocket().getSoTimeout(); } catch (IOException e) { throw new ChannelException(e); } }