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


CODE:
#!/usr/bin/env perl6 use Test; my $server = 
IO::Socket::INET.new(:localhost<127.0.0.1>, :localport(8091), :listen);my 
$supply = Supply.new; my $promise = start({  my $conn = $server.accept;  
$supply.emit($conn);}); $supply.tap(-> $conn {  my $data = '';  'Starting to 
receive.'.say;  while my $d = $conn.recv {    $data ~= $d;  }  'Never gets to 
this line.'.say;  ok $data eq 'Hello, perl6.';}); my $conn = 
IO::Socket::INET.new(:host<127.0.0.1>, :port(8091));'Connection sending 
data.'.say;$conn.send('Hello, perl6.'); await $promise;
-----------------------------------------
Expected:
Starting to receiveConnection sending dataNever gets to this line
-----------------------------------------
Actual:
$conn.recv hangs waiting for data despite data having been sent to the socket
                                          

Reply via email to