My Opera is closing 1st of March

M.I.T = Multimedia IT dept.

socket connection with perl

,

#!/usr/bin/perl
use IO::Socket;
$remote_host="www.ap.ntdtv.com";
$remote_port="80";
#$socket = IO::Socket::INET->new("$remote_host:$remote_port");
#print "$socket\n";


#or die "Can't connect!!: $!\n"
;
$socket = IO::Socket::INET->new(
Proto => "tcp",
Timeout => 5, # in seconds
PeerAddr => $remote_host,
PeerPort => $remote_port,
Type => SOCK_STREAM,
)
#or die $@
;

if($socket) {$success=1};
if(!$socket) {$success=0};
if($success eq 1){print "socket connected!!\n"};
if($success eq 0){print "socket無法建立!!\n"};

# print $socket
#print $socket "data\n";
#$line=<$socket>;
#print $line;
# terminate the connection

close($socket);

easy proxy to use: 3proxy :)firewall rules of iptables for general purpose...

Write a comment

New comments have been disabled for this post.

February 2014
M T W T F S S
January 2014March 2014
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28