in reply to No data received on client socket
recv is for datagram protocols (like UDP). You need to use sysread when using a stream protocol (like TCP).
# Send request. print $oSocket $sSend or die("Unable to write to the socket: $!\n"); # Receive response. my $data_read = ""; my $rv; do { $rv = sysread($oSocket, $data_read, 4096, length($data_read)); die("Unable to read from the socket: $!\n") if not defined $rv; } while $rv;
Tested.
Update: Added code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: No data received on client socket
by rbi (Monk) on Sep 19, 2006 at 17:24 UTC | |
by ikegami (Patriarch) on Sep 19, 2006 at 18:27 UTC | |
by rbi (Monk) on Sep 19, 2006 at 19:42 UTC |