Skip to content

Commit

Permalink
Merge pull request #57 from nponeccop/patch-3
Browse files Browse the repository at this point in the history
ipc:// is not supported on Windows
  • Loading branch information
lestrrat committed Jun 18, 2014
2 parents ae78559 + ab1823d commit ae9b325
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ZMQ-LibZMQ3/t/104_ipc.t
Expand Up @@ -9,18 +9,20 @@ BEGIN {
}

my $path = File::Temp->new(UNLINK => 0);
my $endpoint = $^O eq 'MSWin32' ? 'tcp://127.0.0.1:63'.int(rand(2000)) : "ipc://$path";

my $pid = Test::SharedFork->fork();
if ($pid == 0) {
sleep 1; # hmmm, not a good way to do this...
my $ctxt = zmq_init();
my $child = zmq_socket($ctxt, ZMQ_REQ );
zmq_connect( $child, "ipc://$path" );
zmq_connect( $child, $endpoint );
zmq_sendmsg( $child, zmq_msg_init_data( "Hello from $$" ) );
exit 0;
} elsif ($pid) {
my $ctxt = zmq_init();
my $parent_sock = zmq_socket( $ctxt, ZMQ_REP);
zmq_bind( $parent_sock, "ipc://$path" );
zmq_bind( $parent_sock, $endpoint );
my $msg = zmq_recvmsg( $parent_sock );
my $data = zmq_msg_data($msg);
if (! is $data, "Hello from $pid", "message is the expected message") {
Expand Down
2 changes: 1 addition & 1 deletion ZMQ-LibZMQ3/t/106_last_endpoint.t
Expand Up @@ -11,7 +11,7 @@ my $path = File::Temp->new(UNLINK => 0);

my $ctxt = zmq_init();
my $sock = zmq_socket($ctxt, ZMQ_REQ );
my $set_endpoint = "ipc://$path";
my $set_endpoint = $^O eq 'MSWin32' ? 'inproc://test' : "ipc://$path";
zmq_connect( $sock, $set_endpoint );

my $read_endpoint = zmq_getsockopt($sock, ZMQ_LAST_ENDPOINT);
Expand Down

0 comments on commit ae9b325

Please sign in to comment.