# New Ticket Created by  Robert Lemmen 
# Please include the string:  [perl #130689]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=130689 >


hi everyone,

I have these two tiny pieces of code:

---------------------------8<-- server.p6 --------------------------
my $listen = IO::Socket::INET.new(:listen, :localhost<127.0.0.1>,
:localport(3333));
loop {
    my $conn = $listen.accept;
    while my $buf = $conn.recv(:bin) {
        $conn.write($buf);
    }   
    $conn.close;
}
--------------------------->8---------------------------------------

---------------------------8<-- client.p6 --------------------------
loop (my $i = 0; $i <= $conn_count; $i++) {
    my $conn = IO::Socket::INET.new(host => '127.0.0.1', port => 3333);
    loop (my $j = 0; $j <= $echo_count; $j++) {
        $conn.print("woohoo $i $j\n");
# critical line below: if removed the server crashes without much
# evidence of what is going on... a say does the same trick
        sleep 0.0001;
    }   
    $conn.close;
}

--------------------------->8---------------------------------------

I start up the server and then the client, which runs for about 20s and
then exits as expected. the server stays up.

if you remove the sleep in the client, the server process stops at some
point through without any output.

This is Rakudo version 2017.01-132-g97359ae built on MoarVM version
2017.01-25-g70d4bd5

please let me know if there is anything I can do to help debug or
understand better

thanks  robert

-- 
Robert Lemmen                               http://www.semistable.com 

Attachment: signature.asc
Description: PGP signature

Reply via email to