@Override public boolean isReuseAddress() { try { return javaSocket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public boolean isReuseAddress() { try { return javaSocket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public boolean isReuseAddress() { try { return javaSocket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
public boolean isReuseAddress() { try { return socket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
public <T> T getOption(final Option<T> option) throws UnsupportedOptionException, IOException { if (option == Options.REUSE_ADDRESSES) { return option.cast(Boolean.valueOf(socket.getReuseAddress())); } else if (option == Options.RECEIVE_BUFFER) { return option.cast(Integer.valueOf(socket.getReceiveBufferSize())); } else if (option == Options.SEND_BUFFER) { final int value = sendBuffer; return value == -1 ? null : option.cast(Integer.valueOf(value)); } else if (option == Options.KEEP_ALIVE) { return option.cast(Boolean.valueOf(keepAlive != 0)); } else if (option == Options.TCP_OOB_INLINE) { return option.cast(Boolean.valueOf(oobInline != 0)); } else if (option == Options.TCP_NODELAY) { return option.cast(Boolean.valueOf(tcpNoDelay != 0)); } else if (option == Options.READ_TIMEOUT) { return option.cast(Integer.valueOf(readTimeout)); } else if (option == Options.WRITE_TIMEOUT) { return option.cast(Integer.valueOf(writeTimeout)); } else if (option == Options.CONNECTION_HIGH_WATER) { return option.cast(Integer.valueOf(getHighWater(connectionStatus))); } else if (option == Options.CONNECTION_LOW_WATER) { return option.cast(Integer.valueOf(getLowWater(connectionStatus))); } else { return null; } }
public <T> T getOption(final Option<T> option) throws UnsupportedOptionException, IOException { if (option == Options.REUSE_ADDRESSES) { return option.cast(Boolean.valueOf(socket.getReuseAddress())); } else if (option == Options.RECEIVE_BUFFER) { return option.cast(Integer.valueOf(socket.getReceiveBufferSize())); } else if (option == Options.SEND_BUFFER) { final int value = sendBuffer; return value == -1 ? null : option.cast(Integer.valueOf(value)); } else if (option == Options.KEEP_ALIVE) { return option.cast(Boolean.valueOf(keepAlive != 0)); } else if (option == Options.TCP_OOB_INLINE) { return option.cast(Boolean.valueOf(oobInline != 0)); } else if (option == Options.TCP_NODELAY) { return option.cast(Boolean.valueOf(tcpNoDelay != 0)); } else if (option == Options.READ_TIMEOUT) { return option.cast(Integer.valueOf(readTimeout)); } else if (option == Options.WRITE_TIMEOUT) { return option.cast(Integer.valueOf(writeTimeout)); } else if (option == Options.CONNECTION_HIGH_WATER) { return option.cast(Integer.valueOf(getHighWater(connectionStatus))); } else if (option == Options.CONNECTION_LOW_WATER) { return option.cast(Integer.valueOf(getLowWater(connectionStatus))); } else { return null; } }
public <T> T setOption(final Option<T> option, final T value) throws IllegalArgumentException, IOException { final Object old; if (option == Options.REUSE_ADDRESSES) { old = Boolean.valueOf(socket.getReuseAddress()); socket.setReuseAddress(Options.REUSE_ADDRESSES.cast(value, Boolean.FALSE).booleanValue()); } else if (option == Options.RECEIVE_BUFFER) {
public <T> T setOption(final Option<T> option, final T value) throws IllegalArgumentException, IOException { final Object old; if (option == Options.REUSE_ADDRESSES) { old = Boolean.valueOf(socket.getReuseAddress()); socket.setReuseAddress(Options.REUSE_ADDRESSES.cast(value, Boolean.FALSE).booleanValue()); } else if (option == Options.RECEIVE_BUFFER) {
/** * {@inheritDoc} * * Forwards to {@link #delegate}. */ @Override public boolean getReuseAddress() throws SocketException { return delegate.getReuseAddress(); }
@Override public boolean isReuseAddress() { try { return javaSocket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public boolean isReuseAddress() { try { return javaSocket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public boolean isReuseAddress() { try { return javaSocket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public boolean isReuseAddress() { try { return javaSocket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public boolean isReuseAddress() { try { return javaSocket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public boolean isReuseAddress() { try { return javaSocket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public boolean isReuseAddress() { try { return javaSocket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public boolean isReuseAddress() { try { return javaSocket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public boolean isReuseAddress() { try { return javaSocket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public boolean isReuseAddress() { try { return javaSocket.getReuseAddress(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public boolean getReuseAddress() throws SocketException { if(!MockFramework.isEnabled()){ return super.getReuseAddress(); } if (isClosed()) throw new SocketException("Socket is closed"); return ((Boolean) (getImpl().getOption(SocketOptions.SO_REUSEADDR))).booleanValue(); }