Hi,

I am running into a problem where an embperl page with the code below
hangs during the while loop reading data from a remote socket. This
function works fine as a standard perl script called cgi under mod_perl.
Has anyone seen this behavior or know of a workaround or fix?

Using:
Embperl     v1.3.1
mod_perl    v1.25
IO::Socket  v1.7
Apache      v1.3.17

Thanks in advance,
Kent

use IO::Socket;

sub MakeRequest {
    my ($msg) = @_;
    my $socket;
    my $data;
    $socket = IO::Socket::INET->new( PeerAddr => "x.x.x.x",
                 PeerPort => "yyyy",
                 Proto    => "tcp",
                 Type     => SOCK_STREAM )
        or die "Couldn't connect : $@\n";
    $msg = $XML_HEAD . $msg;
    print $socket $msg;
    $msg = "";
    while ( ! ( ($data = <$socket>) =~ "</EOF>" ) ) {
        $msg .= $data;
    }
    $msg .= $data;
    close( $socket );
    return $msg;
}


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to