# client
# http://perldoc.perl.org/perlipc.html#Sockets%3a-Client%2fServer-Communication
use Socket;
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto);
$port = '3306';
$remote = '192.168.123.123';
$iaddr = inet_aton($remote);
$paddr = sockaddr_in($port,$iaddr);
connect(SOCK,$paddr);
@lines = <SOCK>;
print @lines,"\n";
close(SOCK);
# ===================================
# server
# continue...
全站熱搜
留言列表