Sha256: 0090d5d7d8f830fe10d9cea02164c3bbbea93c4e92961fef19d018adba172625
Contents?: true
Size: 972 Bytes
Versions: 33
Compression:
Stored size: 972 Bytes
Contents
class Openall_time_applet::Unix_socket def initialize(args) @args = args #Remove the sock-file if it already exists. File.unlink(Openall_time_applet::CONFIG[:sock_path]) if File.exists?(Openall_time_applet::CONFIG[:sock_path]) #Start Unix-socket. require "socket" @usock = UNIXServer.new(Openall_time_applet::CONFIG[:sock_path]) #Remove the sock-file after this process is done. Kernel.at_exit do File.unlink(Openall_time_applet::CONFIG[:sock_path]) if File.exists?(Openall_time_applet::CONFIG[:sock_path]) end #Start thread that listens for connections through the Unix-socket. Knj::Thread.new do while client = @usock.accept client.each_line do |line| line = line.strip if line.strip == "open_main_window" @args[:oata].show_main else print "Unknown line: #{line}\n" end end end end end end
Version data entries
33 entries across 33 versions & 1 rubygems