EMA has asked for the wisdom of the Perl Monks concerning the following question:
The printing is done inside the parse function. I thought that might be the problem, but replacing the call to parse() with a simple print "$line\n"; did not change the problem.{ $sock = new IO::Socket::INET ( PeerAddr => $host, PeerPort => $port, Proto => 'tcp', Reuse => 1 ); $sock->autoflush(1); print $sock "log in information"; my $read_set = new IO::Select($sock); my $incoming_server_data = ""; while (1) { my @ready = $read_set->can_read(.5); foreach my $rh (@ready) { my $line = <$rh>; $incoming_server_data .= $line; parse(\$incoming_server_data); } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IO::Socket hanging
by etcshadow (Priest) on Nov 22, 2004 at 06:57 UTC | |
|
Re: IO::Socket hanging
by Luca Benini (Scribe) on Nov 22, 2004 at 06:53 UTC |