Sha256: 7e02a1f3f34e9ace5adbbf5de99f52965301656fd42b9b2116fab249d54d7541
Contents?: true
Size: 521 Bytes
Versions: 2
Compression:
Stored size: 521 Bytes
Contents
require 'easy_sockets' host = ARGV[0] || '127.0.0.1' socket_path = ARGV[1] socket_path ||= '/tmp/test_socket' opts = { host: host, socket_path: socket_path, timeout: 300, separator: "\n", logger: Logger.new(STDOUT), } s = EasySockets::UnixSocket.new(opts) [:INT, :QUIT, :TERM].each do |signal| Signal.trap(signal) do exit end end loop do puts "Please write the message you want to send and hit ENTER, or type Ctrl+c to quit:" msg = gets.chomp s.send_msg(msg) end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
easy_sockets-1.0.0 | examples/unix_socket.rb |
easy_sockets-0.1.0 | examples/unix_socket.rb |