Class: Thrift::SSLServerSocket

Inherits:
ServerSocket show all
Defined in:
lib/thrift/transport/ssl_server_socket.rb

Instance Attribute Summary collapse

Attributes inherited from ServerSocket

#handle

Instance Method Summary collapse

Methods inherited from ServerSocket

#accept, #close, #closed?

Methods inherited from BaseServerTransport

#accept, #close, #closed?

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_contextObject

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

#listenObject



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_sObject



37
38
39
# File 'lib/thrift/transport/ssl_server_socket.rb', line 37

def to_s
  "ssl(#{super.to_s})"
end