Class: Rev::UNIXSocket
Constant Summary
Constants inherited from IO
Instance Attribute Summary collapse
-
#address_family ⇒ Object
readonly
Returns the value of attribute address_family.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
-
.connect(path, *args) ⇒ Object
Connect to the given UNIX domain socket.
Instance Method Summary collapse
-
#initialize(socket) ⇒ UNIXSocket
constructor
A new instance of UNIXSocket.
Methods inherited from Socket
#attach, #on_connect, #on_connect_failed, #on_resolve_failed
Methods inherited from IO
#attach, #attached?, #close, #closed?, #detach, #disable, #enable, #enabled?, #evloop, #on_close, #on_read, #on_write_complete, #output_buffer_size, #write
Methods included from Meta
#event_callback, #watcher_delegate
Constructor Details
#initialize(socket) ⇒ UNIXSocket
Returns a new instance of UNIXSocket.
217 218 219 220 221 222 |
# File 'lib/rev/socket.rb', line 217 def initialize(socket) raise ArgumentError, "socket must be a UNIXSocket" unless socket.is_a? ::UNIXSocket super @address_family, @path = socket.peeraddr end |
Instance Attribute Details
#address_family ⇒ Object (readonly)
Returns the value of attribute address_family.
210 211 212 |
# File 'lib/rev/socket.rb', line 210 def address_family @address_family end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
210 211 212 |
# File 'lib/rev/socket.rb', line 210 def path @path end |
Class Method Details
.connect(path, *args) ⇒ Object
Connect to the given UNIX domain socket
213 214 215 |
# File 'lib/rev/socket.rb', line 213 def self.connect(path, *args) new(::UNIXSocket.new(path), *args) end |