Module: TriggerSwitchD::IPC

Defined in:
lib/trigger_switch_d/ipc.rb

Class Method Summary collapse

Class Method Details

.create(socket_path) ⇒ Object

unix socket thread, see README.rdoc for usage



20
21
22
23
24
25
26
# File 'lib/trigger_switch_d/ipc.rb', line 20

def self.create(socket_path)
  File.delete(socket_path) if File.exist? socket_path
  sock = UNIXServer.open(socket_path)
  Thread.start(sock) do |sock|
    outer_loop(sock)
  end
end