281282283284285286287288
ch.socket().setSoLinger(false, 0); } else { ch.socket().setSoLinger(true, linger); } } catch (SocketException e) { throw new RuntimeIOException(e); } }
289290291292293294295296
public boolean isTcpNoDelay() { try { return ch.socket().getTcpNoDelay(); } catch (SocketException e) { throw new RuntimeIOException(e); } }
297298299300301302303304
public void setTcpNoDelay(boolean on) { try { ch.socket().setTcpNoDelay(on); } catch (SocketException e) { throw new RuntimeIOException(e); } }
308309310311312313314315316317318
try { return ch.socket().getTrafficClass(); } catch (SocketException e) { // Throw an exception only when setTrafficClass is also available. if (SocketSessionConfigImpl.isSetTrafficClassAvailable()) { throw new RuntimeIOException(e); } } } return 0;
321322323324325326327328329
public void setTrafficClass(int tc) { if (SocketSessionConfigImpl.isSetTrafficClassAvailable()) { try { ch.socket().setTrafficClass(tc); } catch (SocketException e) { throw new RuntimeIOException(e); } } }
330331332333334335336337
public int getSendBufferSize() { try { return ch.socket().getSendBufferSize(); } catch (SocketException e) { throw new RuntimeIOException(e); } }
339340341342343344345346347
public void setSendBufferSize(int size) { if (SocketSessionConfigImpl.isSetSendBufferSizeAvailable()) { try { ch.socket().setSendBufferSize(size); } catch (SocketException e) { throw new RuntimeIOException(e); } } }
348349350351352353354355
public int getReceiveBufferSize() { try { return ch.socket().getReceiveBufferSize(); } catch (SocketException e) { throw new RuntimeIOException(e); } }
357358359360361362363364365
public void setReceiveBufferSize(int size) { if (SocketSessionConfigImpl.isSetReceiveBufferSizeAvailable()) { try { ch.socket().setReceiveBufferSize(size); } catch (SocketException e) { throw new RuntimeIOException(e); } } }
4950515253545556575859
ServerSocket s = null; try { s = new ServerSocket(); reuseAddress = s.getReuseAddress(); } catch (IOException e) { throw new RuntimeIOException( "Failed to get the default configuration.", e); } finally { if (s != null) { try { s.close();