Class: Bones::RPC::Connection::Socket::SSL

Inherits:
Celluloid::IO::SSLSocket
  • Object
show all
Includes:
Connectable
Defined in:
lib/bones/rpc/connection/socket/ssl.rb

Overview

This is a wrapper around a tcp socket.

Since:

  • 2.0.0

Instance Attribute Summary

Attributes included from Connectable

#host, #port

Instance Method Summary collapse

Methods included from Connectable

#alive?, included, #read, #readpartial, #set_encoding, #write

Constructor Details

#initialize(remote_host, remote_port, local_host = nil, local_port = nil) ⇒ SSL

Initialize the new TCPSocket with SSL.

Examples:

Initialize the socket.

SSL.new("127.0.0.1", 27017)

Parameters:

  • host (String)

    The host.

  • port (Integer)

    The port.

Since:

  • 1.2.0



22
23
24
25
26
27
28
29
30
# File 'lib/bones/rpc/connection/socket/ssl.rb', line 22

def initialize(remote_host, remote_port, local_host = nil, local_port = nil)
  @host, @port = remote_host, remote_port
  handle_socket_errors do
    socket = TCPSocket.new(remote_host, remote_port, local_host, local_port)
    super(socket)
    to_io.sync_close = true
    connect
  end
end