Class: Coolio::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
Methods inherited from IO
#attach, #attached?, #close, #closed?, #detach, #disable, #enable, #enabled?, #evloop, #on_close, #on_read, #on_write_complete, #write
Methods included from Meta
#event_callback, #watcher_delegate
Constructor Details
#initialize(socket) ⇒ UNIXSocket
Returns a new instance of UNIXSocket.
226 227 228 229 230 231 |
# File 'lib/cool.io/socket.rb', line 226 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.
219 220 221 |
# File 'lib/cool.io/socket.rb', line 219 def address_family @address_family end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
219 220 221 |
# File 'lib/cool.io/socket.rb', line 219 def path @path end |
Class Method Details
.connect(path, *args) ⇒ Object
Connect to the given UNIX domain socket
222 223 224 |
# File 'lib/cool.io/socket.rb', line 222 def self.connect(path, *args) new(::UNIXSocket.new(path), *args) end |