Class: EasySockets::UnixSocket

Inherits:
BasicSocket show all
Defined in:
lib/easy_sockets/unix/unix_socket.rb

Overview

Subclass of BasicSocket that implement a Unix socket.

Author:

  • Marcos Ortiz

Constant Summary collapse

DEFAULT_SOCKET_PATH =
'/tmp/unix_socket'

Constants inherited from BasicSocket

BasicSocket::DEFAULT_TIMEOUT

Instance Attribute Summary

Attributes inherited from BasicSocket

#connected, #logger

Instance Method Summary collapse

Methods inherited from BasicSocket

#connect, #disconnect, #send_msg

Methods included from Utils

#log

Constructor Details

#initialize(opts = {}) ⇒ UnixSocket

It also accepts all options that BasicSocket#initialize accepts

Parameters:

  • opts (Hash) (defaults to: {})

    the options to create a socket with.

Options Hash (opts):

  • :socket_path (Integer) — default: '/tmp/unix_socket'

    The unix socket file path.



17
18
19
20
# File 'lib/easy_sockets/unix/unix_socket.rb', line 17

def initialize(opts={})
    super(opts)
    @socket_path = opts[:socket_path] || DEFAULT_SOCKET_PATH
end