diff options
author | Patrick Simianer <p@simianer.de> | 2015-05-27 19:20:00 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2015-05-27 19:20:00 +0200 |
commit | 5b000aa1d539a4c31449c4ccaf15e8ca91bf90ba (patch) | |
tree | 6113257b8d0279526b8d157ef6283274fa2e6cae | |
parent | 2449016e1216879ee0ebdafac0fb44635e6f9796 (diff) |
net: feed.rb with opts
-rwxr-xr-x | feed.rb | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1,12 +1,16 @@ #!/usr/bin/env ruby require 'nanomsg' +require 'trollop' + +conf = Trollop::options do + opt :addr, "URL of socket", :type => :string, :short => '-a', :default => "tcp://127.0.0.1:31337" +end -port = 8888 sock = NanoMsg::PairSocket.new -addr = "tcp://127.0.0.1:#{port}" +addr = conf[:addr] sock.connect addr -puts sock.recv +puts "< got #{sock.recv}" while true line = STDIN.gets |