yiwai 发表于 2015-12-27 09:24:38

Perl AnyEvent::Socket

  还是在不断的改写做尝试。
  做了些小记录把。方便以后翻。。



#!/usr/bin/perl
use Coro;
use AnyEvent::Socket;
use AnyEvent::Ping::TCP;
my @check_list;
my @target=<>;
foreach my $ip (@target){
foreach my $port (1..65535){
push @check_list,async{
$a=tcp_connect $ip => $port, sub {
my $fh = shift
or die "unable to connect: $!";
};
if(!$a){
print "$port open\n";
}
# $result=tcp_ping_ack $ip,$port;
#   nex($ip,$port);
      }
};
};
  这个脚本貌似不太成功,链接成功的就没有提示,不知道为什么。
  判断的基准没找到。
页: [1]
查看完整版本: Perl AnyEvent::Socket