tcpnews
来自「一个很好的unix网络编程框架」· 代码 · 共 23 行
TXT
23 行
#! /usr/bin/perl5use Socket;$host = inet_aton( 'nntp.ix.netcom.com') || die "host: $!";$port = getservbyname( 'nntp', 'tcp' ) || die "bad port";socket( S, PF_INET, SOCK_STREAM, 0 ) || die "socket: $!";connect( S, sockaddr_in( $port, $host ) ) || die "connect: $!";select( S );$| = 1;select( STDOUT );print S "group comp.protocols.tcp-ip\r\n";while ( $line = <S> ){ last if $line =~ /^211/;}($rc, $total, $start, $end ) = split( /\s/, $line );print S "xover $start-$end\nquit\r\n";while ( $line = <S> ){ ( $no, $sub, $auth, $date ) = split( /\t/, $line ); print "$no, $sub, $date\n" if $sub =~ /TCP|UDP/;}close( S );
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?