Class: Thrift::SSLServerSocket
- Inherits:
-
ServerSocket
- Object
- BaseServerTransport
- ServerSocket
- Thrift::SSLServerSocket
- Defined in:
- lib/thrift/transport/ssl_server_socket.rb
Instance Attribute Summary collapse
-
#ssl_context ⇒ Object
Returns the value of attribute ssl_context.
Attributes inherited from ServerSocket
Instance Method Summary collapse
-
#initialize(host_or_port, port = nil, ssl_context = nil) ⇒ SSLServerSocket
constructor
A new instance of SSLServerSocket.
- #listen ⇒ Object
- #to_s ⇒ Object
Methods inherited from ServerSocket
Methods inherited from BaseServerTransport
Constructor Details
#initialize(host_or_port, port = nil, ssl_context = nil) ⇒ SSLServerSocket
Returns a new instance of SSLServerSocket.
25 26 27 28 |
# File 'lib/thrift/transport/ssl_server_socket.rb', line 25 def initialize(host_or_port, port = nil, ssl_context = nil) super(host_or_port, port) @ssl_context = ssl_context end |
Instance Attribute Details
#ssl_context ⇒ Object
Returns the value of attribute ssl_context.
30 31 32 |
# File 'lib/thrift/transport/ssl_server_socket.rb', line 30 def ssl_context @ssl_context end |
Instance Method Details
#listen ⇒ Object
32 33 34 35 |
# File 'lib/thrift/transport/ssl_server_socket.rb', line 32 def listen socket = TCPServer.new(@host, @port) @handle = OpenSSL::SSL::SSLServer.new(socket, @ssl_context) end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/thrift/transport/ssl_server_socket.rb', line 37 def to_s "ssl(#{super.to_s})" end |