We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac0ce5d commit ceaa157Copy full SHA for ceaa157
04-reqres/example-reqrep.rb
@@ -6,8 +6,7 @@
6
7
$port = 2200
8
9
-# server
10
-thread do
+thread do # server
11
ctx = ZMQ::Context.new
12
rep = ctx.socket(ZMQ::REP)
13
rep.bind( "tcp://127.0.0.1:#{$port}" )
@@ -21,13 +20,15 @@
21
20
end
22
23
24
-# client
25
+thread do # client
26
27
req = ctx.socket(ZMQ::REQ)
28
req.connect( "tcp://127.0.0.1:#{$port}" )
29
req.send( "put foo bar" )
30
puts req.recv
+ sleep 1
+ puts req.send( "put foo2 bar2" ) && req.recv
31
+ exit!
32
33
34
join_threads
0 commit comments