Maintenance of Ruby 2.0.0 will end on February 24, 2016. Read more

In Files

  • openssl/lib/openssl/ssl.rb

Parent

Class/Module Index [+]

Quicksearch

OpenSSL::SSL::SSLServer

Attributes

start_immediately[RW]

Public Class Methods

new(svr, ctx) click to toggle source
 
               # File openssl/lib/openssl/ssl.rb, line 248
def initialize(svr, ctx)
  @svr = svr
  @ctx = ctx
  unless ctx.session_id_context
    # see #6137 - session id may not exceed 32 bytes
    prng = ::Random.new($0.hash)
    session_id = prng.bytes(16).unpack('H*')[0]
    @ctx.session_id_context = session_id
  end
  @start_immediately = true
end
            

Public Instance Methods

accept() click to toggle source
 
               # File openssl/lib/openssl/ssl.rb, line 272
def accept
  # Socket#accept returns [socket, addrinfo].
  # TCPServer#accept returns a socket.
  # The following comma strips addrinfo.
  sock, = @svr.accept
  begin
    ssl = OpenSSL::SSL::SSLSocket.new(sock, @ctx)
    ssl.sync_close = true
    ssl.accept if @start_immediately
    ssl
  rescue SSLError => ex
    sock.close
    raise ex
  end
end
            
close() click to toggle source
 
               # File openssl/lib/openssl/ssl.rb, line 288
def close
  @svr.close
end
            
listen(backlog=5) click to toggle source
 
               # File openssl/lib/openssl/ssl.rb, line 264
def listen(backlog=5)
  @svr.listen(backlog)
end
            
shutdown(how=Socket::SHUT_RDWR) click to toggle source
 
               # File openssl/lib/openssl/ssl.rb, line 268
def shutdown(how=Socket::SHUT_RDWR)
  @svr.shutdown(how)
end
            
to_io() click to toggle source
 
               # File openssl/lib/openssl/ssl.rb, line 260
def to_io
  @svr
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus