te
时间:2006-09-01 来源:per1
#!/usr/bin/perl
use strict;
use Socket;
use IO::Handle;
use constant PORT => 6666;
#use constant IP => '192.168.0.91'; print "请输入连接的IP:";
my $ip=<STDIN>;chomp $ip; my $ip2=inet_aton($ip);
my $sock=sockaddr_in(PORT,$ip2);
socket(SOCK2,AF_INET,SOCK_STREAM,6) || die "1.socket can't :$!"; if (connect(SOCK2,$sock)) {
SOCK2->autoflush(1);
print "Connect's OK!";
while (1) { if (<STDIN>) {
my $msg_out=<STDIN>;
print SOCK2 "Client Said:$msg_out";
}
} }
use Socket;
use IO::Handle;
use constant PORT => 6666;
#use constant IP => '192.168.0.91'; print "请输入连接的IP:";
my $ip=<STDIN>;chomp $ip; my $ip2=inet_aton($ip);
my $sock=sockaddr_in(PORT,$ip2);
socket(SOCK2,AF_INET,SOCK_STREAM,6) || die "1.socket can't :$!"; if (connect(SOCK2,$sock)) {
SOCK2->autoflush(1);
print "Connect's OK!";
while (1) { if (<STDIN>) {
my $msg_out=<STDIN>;
print SOCK2 "Client Said:$msg_out";
}
} }
相关阅读 更多 +
排行榜 更多 +