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

Version Path
itrg-invoker-1.6.1 lib/invoker/ipc/server.rb
itrg-invoker-1.6.0 lib/invoker/ipc/server.rb
invoker-1.5.8 lib/invoker/ipc/server.rb
invoker-1.5.7 lib/invoker/ipc/server.rb
invoker-1.5.6 lib/invoker/ipc/server.rb
invoker-1.5.5 lib/invoker/ipc/server.rb
invoker-1.5.4 lib/invoker/ipc/server.rb
invoker-1.5.3 lib/invoker/ipc/server.rb
meepo-1.5.2 lib/invoker/ipc/server.rb
invoker-1.5.1 lib/invoker/ipc/server.rb
invoker-1.4.1 lib/invoker/ipc/server.rb
invoker-1.4.0 lib/invoker/ipc/server.rb
invoker-1.3.2 lib/invoker/ipc/server.rb
invoker-1.3.1 lib/invoker/ipc/server.rb
invoker-1.3.0 lib/invoker/ipc/server.rb
invoker-1.2.0 lib/invoker/ipc/server.rb
invoker-1.2.0.pre2 lib/invoker/ipc/server.rb
invoker-1.2.0.pre1 lib/invoker/ipc/server.rb
invoker-1.2.0.pre lib/invoker/ipc/server.rb
invoker-1.1.0 lib/invoker/ipc/server.rb