#!/usr/bin/perl -w
use IO::Socket;
my $sock = new IO::Socket::INET (
PeerAddr => 'remotehost',
PeerPort => '1230',
Proto => 'tcp',
) or die "ERROR in Socket Creation : $!\n";
print "TCP Connection Success.\n";
# write on the socket to server.
$data = "this is the data to send";
$socket->send($data);
# read the socket data sent by server.
$data = <$socket>;
print "Received from Server : $data\n";
sleep(10);
close($sock);
我無法使用上述代碼發送和接收來自遠程主機的響應......任何想法?代理與Perl腳本
感謝 阿希什
什麼問題? – 2010-07-23 23:30:02
17號線,恕我直言...... – DVK 2010-07-24 00:38:23