Sha256: 28740732204cbf1137b2cb2dafcad7a8e16ebc0e70750ffe794de5401bedd19b
Contents?: true
Size: 592 Bytes
Versions: 20
Compression:
Stored size: 592 Bytes
Contents
require "fileutils" module Invoker module IPC class Server SOCKET_PATH = "/tmp/invoker" def initialize @open_clients = [] Socket.unix_server_loop(SOCKET_PATH) do |sock, client_addrinfo| Thread.new { process_client(sock) } end end def clean_old_socket if File.exist?(SOCKET_PATH) FileUtils.rm(SOCKET_PATH, :force => true) end end def process_client(client_socket) client = Invoker::IPC::ClientHandler.new(client_socket) client.read_and_execute end end end end
Version data entries
20 entries across 20 versions & 3 rubygems