Hi!

I'm trying to use 0mq (Perl) using ipv6, but it doesn't seem to work. 
I've got the latest Debian 3.3 package (3.2.2+dfsg-1) and ZMQ-LibZMQ3-1.09

Attached you can find two trimmed-down versions of the weather server & 
client from the guide, which can be run using ip4 or ipv6 (default is 
ipv6). When I run them using ipv6, the server happily sends messages, 
but the client doesn't receive them. When running with ipv4, the client 
gets messages.

Any ideas / pointers? Is this a problem with the Perl bindings, or a 
general 0mq issue (I'm "only" fluent in Perl, so I didn't try it in C)

To run the attachted scripts with ipv6:
perl weather_server.pl v6
perl weather_client.pl v6

or with ipv4:
perl weather_server.pl v4
perl weather_client.pl v4


Greetings,
domm


-- 
#!/usr/bin/perl                              http://domm.plix.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}
#!/usr/bin/perl
use strict;
use warnings;
use 5.10.0;
use ZMQ::LibZMQ3;
use ZMQ::Constants qw(ZMQ_PUB ZMQ_IPV4ONLY);

my %ips = (
    v6 => '::1',
    v4 => '127.0.0.1',
);
my $ip = $ips{$ARGV[0] || 'v6'};
say "Using IP $ip";

my $context = zmq_init();
my $publisher = zmq_socket($context, ZMQ_PUB);
zmq_bind($publisher, 'tcp://'.$ip.':5556');
zmq_setsockopt($publisher, ZMQ_IPV4ONLY, 0);

while (1) {
    my $number = int(rand(100));
    say $number;
    zmq_send($publisher, "some number: $number");
    sleep(1);
}

#!/usr/bin/perl
use strict;
use warnings;
use 5.10.0;
use ZMQ::LibZMQ3;
use ZMQ::Constants qw(ZMQ_SUB ZMQ_SUBSCRIBE ZMQ_IPV4ONLY);

my %ips = (
    v6 => '::1',
    v4 => '127.0.0.1',
);
my $ip = $ips{$ARGV[0] || 'v6'};
say "Using IP $ip";

my $context = zmq_init();
my $subscriber = zmq_socket($context, ZMQ_SUB);
zmq_connect($subscriber, 'tcp://'.$ip.':5556');
zmq_setsockopt($subscriber, ZMQ_IPV4ONLY, 0);
zmq_setsockopt($subscriber, ZMQ_SUBSCRIBE,'');

for (1 .. 10) {
    my $string = zmq_msg_data(zmq_recvmsg($subscriber));
    say "got $string";
}

_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to