/** * {@inheritDoc} */ @Override public int getSoTimeout() throws SocketException { return getSocket().getSoTimeout(); }
/** * Sets the socket read timeout. * * @param timeout read timeout (SO_TIMEOUT) in milliseconds */ @Override public void setSoTimeout(int timeout) throws SocketException { getSocket().setSoTimeout(timeout); this.timeout = timeout; }
/** * Sets the socket read timeout. * * @param timeout read timeout (SO_TIMEOUT) in milliseconds */ @Override public void setTimeout(int timeout) { try { getSocket().setSoTimeout(timeout); this.timeout = timeout; } catch (SocketException se) { LOGGER.warn("Could not set socket timeout.", se); } }
final Socket socket = getSocket(); try { socket.connect(new InetSocketAddress(this.hostAddress, this.port),
/** * Creates a new unconnected SSL socket that will connect to the given host on * the given port. * * @param hostAddress Resolved remote host address * @param port Remote port * @param timeout Socket timeout * @param params Socket parameters including SSL properties */ public SnappyTSSLSocket(InetAddress hostAddress, int port, int timeout, SocketParameters params) throws TTransportException { super(initSSLSocket(hostAddress, port, params, timeout)); this.hostAddress = hostAddress; this.port = port; final Socket socket = getSocket(); setProperties(socket, timeout, params); if (!isOpen()) { this.open(); } this.socketToSameHost = ClientSharedUtils.isSocketToSameHost( socket.getLocalSocketAddress(), socket.getRemoteSocketAddress()); }