in reply to Re^3: how send message without new-line terminator on IO::Socket
in thread how send message without new-line terminator on IO::Socket
read is not ok, because is mapped on fread instead I used sysread.
I replaced the statemente :$sres = <$new_sock>; with the following code:
(mybe it should be helpfull to someone else )
$rin="";
$sres = "";
vec($rin,fileno($new_sock),1) = 1;
$nfound=select( $rin, undef, undef, .1 );
while ( $nfound )
{
sysread( $new_sock, $c, 1 );
chomp $c;
$sres .= $c;
$nfound=select( $rin, undef, undef, .1 );
}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: how send message without new-line terminator on IO::Socket (sysread chomp select)
by tye (Sage) on Jul 26, 2006 at 15:12 UTC | |
by earlati2 (Beadle) on Jul 27, 2006 at 07:33 UTC |