Class: Moped::Connection::Socket::SSL
- Inherits:
-
OpenSSL::SSL::SSLSocket
- Object
- OpenSSL::SSL::SSLSocket
- Moped::Connection::Socket::SSL
- Includes:
- Connectable
- Defined in:
- lib/moped/connection/socket/ssl.rb
Overview
This is a wrapper around a tcp socket.
Instance Attribute Summary collapse
- #socket ⇒ Object readonly
Attributes included from Connectable
Instance Method Summary collapse
-
#initialize(host, port) ⇒ SSL
constructor
Initialize the new TCPSocket with SSL.
-
#set_encoding(string) ⇒ Object
Set the encoding of the underlying socket.
-
#setsockopt(*args) ⇒ Object
Set a socket option on the underlying socket.
Methods included from Connectable
#alive?, included, #read, #write
Constructor Details
#initialize(host, port) ⇒ SSL
Initialize the new TCPSocket with SSL.
22 23 24 25 26 27 28 29 30 |
# File 'lib/moped/connection/socket/ssl.rb', line 22 def initialize(host, port) @host, @port = host, port handle_socket_errors do @socket = TCPSocket.new(host, port) super(socket) self.sync_close = true connect end end |
Instance Attribute Details
#socket ⇒ Object (readonly)
11 12 13 |
# File 'lib/moped/connection/socket/ssl.rb', line 11 def socket @socket end |
Instance Method Details
#set_encoding(string) ⇒ Object
Set the encoding of the underlying socket.
37 38 39 |
# File 'lib/moped/connection/socket/ssl.rb', line 37 def set_encoding(string) socket.set_encoding(string) end |
#setsockopt(*args) ⇒ Object
Set a socket option on the underlying socket.
46 47 48 |
# File 'lib/moped/connection/socket/ssl.rb', line 46 def setsockopt(*args) socket.setsockopt(*args) end |