Skip to content

Instantly share code, notes, and snippets.

@wjessop
Created July 31, 2010 22:34
Show Gist options
  • Save wjessop/502689 to your computer and use it in GitHub Desktop.
Save wjessop/502689 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'zmq'
z = ZMQ::Context.new
s = z.socket(ZMQ::UPSTREAM)
s.connect "tcp://127.0.0.1:4010"
while true
puts s.recv
end
require 'rubygems'
require 'zmq'
z = ZMQ::Context.new
s = z.socket(ZMQ::DOWNSTREAM)
s.bind("tcp://127.0.0.1:4010")
10.times do |c|
puts s.send(c.to_s)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment