class Invoker::IPC::Server

Constants

SOCKET_PATH

Public Class Methods

new() click to toggle source
# File lib/invoker/ipc/server.rb, line 7
def initialize
  @open_clients = []
  Socket.unix_server_loop(SOCKET_PATH) do |sock, client_addrinfo|
    Thread.new { process_client(sock) }
  end
end

Public Instance Methods

clean_old_socket() click to toggle source
# File lib/invoker/ipc/server.rb, line 14
def clean_old_socket
  if File.exist?(SOCKET_PATH)
    FileUtils.rm(SOCKET_PATH, :force => true)
  end
end
process_client(client_socket) click to toggle source
# File lib/invoker/ipc/server.rb, line 20
def process_client(client_socket)
  client = Invoker::IPC::ClientHandler.new(client_socket)
  client.read_and_execute
end