Class: Moped::Sockets::SSL
- Includes:
- Connectable
- Defined in:
- lib/moped/sockets/ssl.rb
Overview
This is a wrapper around a tcp socket.
Instance Attribute Summary collapse
-
#socket ⇒ Object
readonly
Returns the value of attribute socket.
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.
21 22 23 24 25 26 27 28 29 |
# File 'lib/moped/sockets/ssl.rb', line 21 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)
Returns the value of attribute socket.
10 11 12 |
# File 'lib/moped/sockets/ssl.rb', line 10 def socket @socket end |
Instance Method Details
#set_encoding(string) ⇒ Object
Set the encoding of the underlying socket.
36 37 38 |
# File 'lib/moped/sockets/ssl.rb', line 36 def set_encoding(string) socket.set_encoding(string) end |
#setsockopt(*args) ⇒ Object
Set a socket option on the underlying socket.
45 46 47 |
# File 'lib/moped/sockets/ssl.rb', line 45 def setsockopt(*args) socket.setsockopt(*args) end |