diff options
author | Patrick Simianer <p@simianer.de> | 2015-03-25 15:23:41 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2015-03-25 15:23:41 +0100 |
commit | 9aa075c79122709d8d5b8adf8c91ebd348eac658 (patch) | |
tree | 90d59e442881801fbf51de0ba5a5582c2049d9b3 /decoder/feed.rb | |
parent | 4ce8dd5d091d63fcafddb447475ae36f769fd8c5 (diff) |
updated network_decoder
Diffstat (limited to 'decoder/feed.rb')
-rwxr-xr-x | decoder/feed.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/decoder/feed.rb b/decoder/feed.rb new file mode 100755 index 00000000..c835536c --- /dev/null +++ b/decoder/feed.rb @@ -0,0 +1,21 @@ +#!/usr/bin/env ruby + +require 'nanomsg' + +port = 60666 +sock = NanoMsg::PairSocket.new +addr = "tcp://127.0.0.1:#{port}" +#addr = "ipc:///tmp/network_decoder.ipc" +sock.connect addr + +while true + line = STDIN.gets + if !line + sock.send 'shutdown' + break + end + sock.send line.strip + sleep 1 + puts "got translation: #{sock.recv}\n\n" +end + |