diff options
author | Patrick Simianer <p@simianer.de> | 2015-05-08 21:42:14 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2015-05-08 21:42:14 +0200 |
commit | f678b442e8a0c2e685652d2b7006ccccce989c81 (patch) | |
tree | bc30d6d2153b7ad3eb7cbcd4566c85c9ea798cdf /word-aligner/feed.rb | |
parent | ce920c84348050d2bd2861c1ce4e645a8690afc1 (diff) |
net_fa
Diffstat (limited to 'word-aligner/feed.rb')
-rwxr-xr-x | word-aligner/feed.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/word-aligner/feed.rb b/word-aligner/feed.rb new file mode 100755 index 00000000..6aa80d95 --- /dev/null +++ b/word-aligner/feed.rb @@ -0,0 +1,23 @@ +#!/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 || line.strip=='shutdown' + puts "shutting down" + sock.send 'shutdown' + break + end + puts "sending '#{line.strip}'" + sock.send line.strip + sleep 1 + puts "got alignment: #{sock.recv}\n\n" +end + |