Class: Coolio::UNIXServer

Inherits:
Server show all
Defined in:
lib/cool.io/server.rb

Overview

UNIX server class. Listens on the specified UNIX domain socket and creates new connection objects of the given class. Optionally, it can also take any existing core UNIXServer object as path and create a Coolio::UNIXServer out of it.

Instance Method Summary collapse

Methods inherited from Server

#fileno

Methods inherited from Listener

#close, #fileno, #listen, #on_connection

Methods inherited from IOWatcher

#attach, #detach, #disable, #enable, #on_readable, #on_writable

Methods included from Meta

#event_callback, #watcher_delegate

Methods inherited from Watcher

#attach, #attached?, #detach, #disable, #enable, #enabled?, #evloop

Constructor Details

#initialize(path, klass = UNIXSocket, *args, &block) ⇒ UNIXServer

Returns a new instance of UNIXServer.


69
70
71
72
73
# File 'lib/cool.io/server.rb', line 69

def initialize(path, klass = UNIXSocket, *args, &block)
  s = ::UNIXServer === path ? path : ::UNIXServer.new(path)
  s.instance_eval { listen(DEFAULT_BACKLOG) }
  super(s, klass, *args, &block)
end