lib/aerospike/socket/base.rb
# Note: For SSL connections, read_nonblock may invoke write system call,
# which may raise IO::WaitWritable, and vice versa, due to SSL
# renegotiation, so we should always rescue both.
For SSL connections, read_nonblock may invoke write system call,
which may raise IO::WaitWritable, and vice versa, due to SSL
renegotiation, so we should always rescue both.
For SSL connections read_nonblock may invoke write system call which may raise IO :: WaitWritable and vice versa due to SSL renegotiation so we should always rescue both .
def with_timeout(timeout, &block)
        block.call
      rescue IO::WaitReadable => e
        if IO::select([self], nil, nil, timeout)
          retry
        else
          fail Aerospike::Exceptions::Connection, "Socket timeout: #{e}"
        end
      rescue IO::WaitWritable => e
        if IO::select(nil, [self], nil, timeout)
          retry
        else
          fail Aerospike::Exceptions::Connection, "Socket timeout: #{e}"
        end
      rescue => e
        raise Aerospike::Exceptions::Connection, "Socket error: #{e}"
      end
def with_timeout ( timeout , & block ) block . call rescue IO :: WaitReadable => e if IO :: select ( [ self ] , nil , nil , timeout ) retry else fail Aerospike :: Exceptions :: Connection , "Socket timeout: #{e}" end rescue IO :: WaitWritable => e if IO :: select ( nil , [ self ] , nil , timeout ) retry else fail Aerospike :: Exceptions :: Connection , "Socket timeout: #{e}" end rescue => e raise Aerospike :: Exceptions :: Connection , "Socket error: #{e}" end
Note: For SSL connections, read_nonblock may invoke write system call,
which may raise IO::WaitWritable, and vice versa, due to SSL
renegotiation, so we should always rescue both.
Note : For SSL connections read_nonblock may invoke write system call which may raise IO :: WaitWritable and vice versa due to SSL renegotiation so we should always rescue both .
timeout
block