Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 24 lines (16 sloc) 0.366 kB
#!/usr/bin/env ruby
require 'rubygems'
require 'zmq'
unless ARGV.length == 1
puts "usage: publisher.rb port"
exit
end
port = ARGV[0]
puts "Publishing on port #{port}..."
context = ZMQ::Context.new(1)
publisher = context.socket(ZMQ::PUB)
publisher.setsockopt(ZMQ::HWM, 10);
publisher.bind("tcp://*:#{port}")
STDIN.each_line do |l|
publisher.send(l)
end
Jump to Line
Something went wrong with that request. Please try again.