@Override public T newChannel() { try { return ReflectionUtils.instantiateWithCustomCtor(clazz.getName(), new Class[] { InternetProtocolFamily.class }, new Object[] { family }); } catch (Throwable t) { throw new ChannelException("Unable to create Channel from class " + clazz, t); } }
@Override public OioSocketChannelConfig setSoTimeout(int timeout) { try { javaSocket.setSoTimeout(timeout); } catch (IOException e) { throw new ChannelException(e); } return this; }
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 clazz.getConstructor().newInstance(); } catch (Throwable t) { throw new ChannelException("Unable to create Channel from class " + clazz, t); } }
@Override public SctpChannelConfig setSctpNoDelay(boolean sctpNoDelay) { try { javaChannel.setOption(SctpStandardSocketOptions.SCTP_NODELAY, sctpNoDelay); } catch (IOException e) { throw new ChannelException(e); } return this; }
@Override public int getSendBufferSize() { try { return javaChannel.getOption(SctpStandardSocketOptions.SO_SNDBUF); } catch (IOException e) { throw new ChannelException(e); } }
@Override public SctpChannelConfig setSendBufferSize(int sendBufferSize) { try { javaChannel.setOption(SctpStandardSocketOptions.SO_SNDBUF, sendBufferSize); } catch (IOException e) { throw new ChannelException(e); } return this; }
@Override public SctpChannelConfig setReceiveBufferSize(int receiveBufferSize) { try { javaChannel.setOption(SctpStandardSocketOptions.SO_RCVBUF, receiveBufferSize); } catch (IOException e) { throw new ChannelException(e); } return this; }
public boolean isReuseAddress() { try { return channel.socket.isReuseAddress(); } catch (IOException e) { throw new ChannelException(e); } }
static boolean isSoErrorZero(BsdSocket fd) { try { return fd.getSoError() == 0; } catch (IOException e) { throw new ChannelException(e); } }
/** * Get the {@code TCP_KEEPINTVL} option on the socket. See {@code man 7 tcp} for more details. */ public int getTcpKeepIntvl() { try { return channel.socket.getTcpKeepIntvl(); } catch (IOException e) { throw new ChannelException(e); } }
@Override public EpollSocketChannelConfig setReuseAddress(boolean reuseAddress) { try { channel.socket.setReuseAddress(reuseAddress); return this; } catch (IOException e) { throw new ChannelException(e); } }
@Override public EpollSocketChannelConfig setTrafficClass(int trafficClass) { try { channel.socket.setTrafficClass(trafficClass); return this; } catch (IOException e) { throw new ChannelException(e); } }
/** * Set the {@code TCP_KEEPIDLE} option on the socket. See {@code man 7 tcp} for more details. */ public EpollSocketChannelConfig setTcpKeepIdle(int seconds) { try { channel.socket.setTcpKeepIdle(seconds); return this; } catch (IOException e) { throw new ChannelException(e); } }
/** * Set the {@code TCP_USER_TIMEOUT} option on the socket. See {@code man 7 tcp} for more details. */ public EpollSocketChannelConfig setTcpUserTimeout(int milliseconds) { try { channel.socket.setTcpUserTimeout(milliseconds); return this; } catch (IOException e) { throw new ChannelException(e); } }
@Override public int getSoLinger() { try { return channel.socket.getSoLinger(); } catch (IOException e) { throw new ChannelException(e); } }
@Override public int getTrafficClass() { try { return channel.socket.getTrafficClass(); } catch (IOException e) { throw new ChannelException(e); } }
public void setTcpNoPush(boolean tcpNoPush) { try { channel.socket.setTcpNoPush(tcpNoPush); } catch (IOException e) { throw new ChannelException(e); } }
@Override public KQueueSocketChannelConfig setSoLinger(int soLinger) { try { channel.socket.setSoLinger(soLinger); return this; } catch (IOException e) { throw new ChannelException(e); } }
@Override public boolean isBroadcast() { try { return datagramChannel.socket.isBroadcast(); } catch (IOException e) { throw new ChannelException(e); } }