Class: Bones::RPC::Synchronous::Connection::Socket::SSL
- Inherits:
-
OpenSSL::SSL::SSLSocket
- Object
- OpenSSL::SSL::SSLSocket
- Bones::RPC::Synchronous::Connection::Socket::SSL
- Includes:
- Connection::Socket::Connectable
- Defined in:
- lib/bones/rpc/synchronous/connection/socket/ssl.rb
Overview
This is a wrapper around a tcp socket.
Instance Attribute Summary collapse
- #socket ⇒ Object readonly
Attributes included from Connection::Socket::Connectable
Instance Method Summary collapse
-
#initialize(remote_host, remote_port, local_host = nil, local_port = nil) ⇒ 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 Connection::Socket::Connectable
#alive?, included, #read, #readpartial, #write
Constructor Details
#initialize(remote_host, remote_port, local_host = nil, local_port = nil) ⇒ SSL
Initialize the new TCPSocket with SSL.
25 26 27 28 29 30 31 32 33 |
# File 'lib/bones/rpc/synchronous/connection/socket/ssl.rb', line 25 def initialize(remote_host, remote_port, local_host = nil, local_port = nil) @host, @port = remote_host.to_s, remote_port handle_socket_errors do @socket = TCPSocket.new(@host, remote_port, local_host, local_port) super(socket) self.sync_close = true connect end end |
Instance Attribute Details
#socket ⇒ Object (readonly)
14 15 16 |
# File 'lib/bones/rpc/synchronous/connection/socket/ssl.rb', line 14 def socket @socket end |
Instance Method Details
#set_encoding(string) ⇒ Object
Set the encoding of the underlying socket.
40 41 42 |
# File 'lib/bones/rpc/synchronous/connection/socket/ssl.rb', line 40 def set_encoding(string) socket.set_encoding(string) end |
#setsockopt(*args) ⇒ Object
Set a socket option on the underlying socket.
49 50 51 |
# File 'lib/bones/rpc/synchronous/connection/socket/ssl.rb', line 49 def setsockopt(*args) socket.setsockopt(*args) end |