Skip to content

Commit

Permalink
update example code to match new API
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuck Remes committed Jan 12, 2012
1 parent 5303c3d commit 4756dfa
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions README.rdoc
Expand Up @@ -93,13 +93,14 @@ All features are implemented.

ctx = ZMQ::Context.new
s = ctx.socket ZMQ::REP
s.setsockopt(ZMQ::HWM, 100)
s.bind(bind_to)
rc = s.setsockopt(ZMQ::HWM, 100)
rc = s.bind(bind_to)

msg = ""
roundtrip_count.times do
msg = s.recv_string 0
rc = s.recv_string msg
raise "Message size doesn't match, expected [#{message_size}] but received [#{msg.size}]" if message_size != msg.size
s.send_string msg, 0
rc = s.send_string msg, 0
end


Expand All @@ -119,15 +120,16 @@ All features are implemented.

ctx = ZMQ::Context.new
s = ctx.socket ZMQ::REQ
s.connect(connect_to)
rc = s.connect(connect_to)

msg = "#{ '3' * message_size }"

start_time = Time.now

msg = ""
roundtrip_count.times do
s.send_string msg, 0
msg = s.recv_string 0
rc = s.send_string msg, 0
rc = s.recv_string msg
raise "Message size doesn't match, expected [#{message_size}] but received [#{msg.size}]" if message_size != msg.size
end

Expand Down

0 comments on commit 4756dfa

Please sign in to comment.