Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mac] IO::Socket::Async のなかで run すると exit する #6

Open
tokuhirom opened this issue Oct 6, 2015 · 1 comment
Open

Comments

@tokuhirom
Copy link
Contributor

以下のテストが、run ls の時点で落ちる。

#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use 5.010000;
use autodie;

use Test::More;
use IO::Socket::INET;

my $pid = fork();
if ($pid > 0) { # parent
    say 'sleep';

    sleep 3;

    say 'connect';
    my $sock = IO::Socket::INET->new(PeerAddr => 'localhost:5000');
    $sock or die;
    my $msg = <$sock>;
    is $msg, "yo\n";
    kill $pid;
    waitpid $pid, 0;
} elsif ($pid == 0) {
    say 'executing server';
    exec 'perl6-m', 'server.pl6';
} else {
die 'fork failed';
}


done_testing;
use v6;

say 'spawned sever';

react {
    whenever IO::Socket::Async.listen('127.0.0.1', 5000) -> $conn {
         run 'ls';
        await $conn.print("yo\n");
        $conn.close();
    }
}
@tokuhirom
Copy link
Contributor Author

reported: https://t.co/EsOjTcKrn6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant