Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The output from the above code is:($client) = $socket->accept(); my $read = ""; my $buffer; print "DEBUG Point: 1\n"; while (read($client,$buffer,1024) > 0) { print "DEBUG Point: 2\n"; $read .= $buffer; } print "DEBUG Point: 3\n"; print "$data \n";
At this point it just sits and waits. Doesn't continue looping endlessly. If i terminate the connection from the client's end if then spits out the following:DEBUG Point: 1 DEBUG Point: 2
If i send enough data through that it needs to loop several times to read it all, it will print the "DEBUG Point: 2" a couple times (as one would expect) and then just sits and wait until the client terminates the connection.DEBUG Point: 3 Test Data
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sockets + Read
by dave_the_m (Monsignor) on Aug 17, 2005 at 23:33 UTC | |
by Anonymous Monk on Aug 18, 2005 at 00:08 UTC | |
by dave_the_m (Monsignor) on Aug 18, 2005 at 09:35 UTC | |
|
Re: Sockets + Read
by Codon (Friar) on Aug 17, 2005 at 23:21 UTC | |
by tye (Sage) on Aug 17, 2005 at 23:28 UTC | |
|
Re: Sockets + Read (sysread)
by tye (Sage) on Aug 17, 2005 at 23:26 UTC | |
by Anonymous Monk on Aug 17, 2005 at 23:46 UTC | |
|
Re: Sockets + Read
by Roger (Parson) on Aug 18, 2005 at 00:32 UTC |