fork download
  1. require 'socket'
  2.  
  3. path = Dir.glob('/tmp/**/shibboleet*').first
  4. raise "nope.avi" if path.nil?
  5.  
  6. puts "** found server: #{path}"
  7. socket = UNIXSocket.new path
  8. socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, true)
  9.  
  10. 5.times do |i|
  11. tx = "client says #{i}!"
  12. puts "<< #{socket.readline.chomp}"
  13. socket.puts tx
  14. puts ">> #{tx}"
  15. sleep 0.5
  16. end
  17.  
  18. socket.close
Runtime error #stdin #stdout #stderr 0.02s 7900KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.rb:4:in `<main>': nope.avi (RuntimeError)