madhu.hanigadde has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use IO::Socket; $|=1; $socket = new IO::Socket::INET ( PeerAddr => '$IP', PeerPort => 3575, Proto => 'tcp', ) or die "Couldn't connect to Server\n"; while (1) { $send_data = "CHK $ARGV[0]"; print STDERR "\nSEND( TYPE q or Q to Quit):$send_data\n"; if ($send_data ne 'q' and $send_data ne 'Q') { $socket->send($send_data); sleep(1); $socket->recv($recv_data1,1024); sleep(1); $socket->recv($recv_data2,10240); print "RECIEVED: $recv_data2\n"; close $socket; last; } else { $socket->send($send_data); close $socket; last; } }
20090213 Janitored by Corion: Closed code tag, as per Writeup Formatting Tips
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: recv in socket programming
by gone2015 (Deacon) on Feb 12, 2009 at 13:20 UTC | |
|
Re: recv in socket programming
by irah (Pilgrim) on Feb 12, 2009 at 12:39 UTC | |
|
Re: recv in socket programming
by weismat (Friar) on Feb 12, 2009 at 12:33 UTC |