SergGulko

ZMQ.REQ/REP problem(client)

Feb 26th, 2012
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.26 KB | None | 0 0
  1. my $context = ZeroMQ::Context->new();
  2. my $json = JSON->new->allow_nonref(1);
  3.  
  4. my $socket = $context->socket(ZMQ_REQ);
  5. $socket->connect($server_url);
  6.  
  7. for(my $i = 0;$i < 10;$i++) {
  8.     $socket->send($i);
  9.     my $answer = $json->decode($socket->recv()->data);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment