in reply to No data received on client socket
I'd really be grateful if someone can explain me what is not working in the other ways (my original one and the suggested modifications), and how the other ones should be modified in order to work.my $oSocket = IO::Socket::INET->new(PeerAddr => $HostName, + PeerPort => $Port, + Timeout => $SocketTimeout, Type => SOCK_STREAM); my $sSend = "<?xml version=\"1.0\"?> <request>" . "<connectionstring>" . $ConnectionString . "</connectionstring>" . "<sql><![CDATA[" . $sSQL . "]]></sql></request>"; + local *FH = $oSocket; print FH $sSend; while (<FH>) { print $_ };
... local *FH = $oSocket; print FH $sSend; while (1) { sysread($oSocket, $data_read, 4096,length($data_read)); $sRet .= $data_read; last if ($data_read =~ /<\/xml>/i); }; close (FH); print $sRet;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: No data received on client socket
by ikegami (Patriarch) on Sep 21, 2006 at 15:52 UTC | |
by rbi (Monk) on Sep 21, 2006 at 16:07 UTC |