首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > C/C++ > Linux C--利用Socket、多线程批量生成静态网页
【标  题】:Linux C--利用Socket、多线程批量生成静态网页
【关键字】:Linux,C--,Socket
【来  源】:http://www.cublog.cn/u/13329/showart.php?id=244004

Linux C--利用Socket、多线程批量生成静态网页

文件:gethtml_debug_0702072.tar.gz
大小:18KB
下载:下载


程序(用Linux C做的)基本上可以运行, 欢迎大家试验,也欢迎大家批评指正。

效果如:
#./gethtml

#tail -n 150 /var/log/messages

Feb  7 09:55:35 localhost gethtml: connect to host www.ctvhr.com//main.php [3085867920:utils.h:326]
Feb  7 09:55:35 localhost gethtml: connect to host www.56hr.com//main.php [3075378064:utils.h:326]
Feb  7 09:55:35 localhost gethtml: connect to host www.mechr.com//main.php [3064888208:utils.h:326]
eb  7 09:55:36 localhost gethtml: File len: 1680 bytes
Feb  7 09:55:36 localhost gethtml: File len: 1448 bytes
Feb  7 09:55:36 localhost gethtml: File len: 2896 bytes
Feb  7 09:55:36 localhost gethtml: File len: 4000 bytes
Feb  7 09:55:36 localhost gethtml: File len: 4101 bytes
Feb  7 09:55:36 localhost gethtml: File len: 1620 bytes
Feb  7 09:55:36 localhost gethtml: GET [http://www.56hr.com/main.php]...OK
Feb  7 09:55:36 localhost gethtml: File len: 1448 bytes
Feb  7 09:55:36 localhost last message repeated 5 times
eb  7 09:55:36 localhost gethtml: File len: 4101 bytes
Feb  7 09:55:36 localhost gethtml: File len: 34 bytes
Feb  7 09:55:36 localhost gethtml: File len: 1719 bytes
Feb  7 09:55:36 localhost gethtml: GET [http://www.ctvhr.com/main.php]...OK
Feb  7 09:55:36 localhost gethtml: File len: 1448 bytes
Feb  7 09:55:36 localhost last message repeated 2 times
Feb  7 09:55:36 localhost gethtml: File len: 1935 bytes
Feb  7 09:55:36 localhost gethtml: GET [http://www.mechr.com/main.php]...OK
Feb  7 09:55:36 localhost gethtml: connect to host www.cneduhr.com//main.php [3064888208:utils.h:326]
Feb  7 09:55:36 localhost gethtml: File len: 248 bytes
Feb  7 09:55:36 localhost gethtml: File len: 4101 bytes
Feb  7 09:55:36 localhost gethtml: File len: 1381 bytes
Feb  7 09:55:36 localhost gethtml: File len: 1448 bytes
Feb  7 09:55:36 localhost gethtml: File len: 359 bytes
Feb  7 09:55:36 localhost gethtml: GET [http://www.cneduhr.com/main.php]...OK
Feb  7 10:24:18 localhost gethtml: connect to host www.800hr.com//main.php [3086510992:utils.h:326]
Feb  7 10:24:18 localhost gethtml: connect to host www.buildhr.com//maindoc/new/commerce/rcsc/index.php?create_target=buildhr.com [3076021136:utils.h:326]
Feb  7 10:24:18 localhost gethtml: connect to host www.bankhr.com//main.php [3055041424:utils.h:326]
Feb  7 10:24:18 localhost gethtml: connect to host www.elehr.com//main.php [3065531280:utils.h:326]
Feb  7 10:24:18 localhost gethtml: connect to host www.cnithr.com//main.php [3044551568:utils.h:326]
Feb  7 10:24:18 localhost gethtml: [utils.h:676]Connect Error: www.buildhr.com Network is unreachable
Feb  7 10:24:18 localhost gethtml: Connect to www.buildhr.com error... [utils.h:cns_makehtml:331]
Feb  7 10:24:18 localhost gethtml: connect to host www.healthr.com//main.php [3076021136:utils.h:326]
Feb  7 10:24:18 localhost gethtml: File len: 1448 bytes
Feb  7 10:24:18 localhost last message repeated 4 times
Feb  7 10:24:18 localhost gethtml: File len: 86 bytes
Feb  7 10:24:18 localhost gethtml: File len: 1448 bytes
Feb  7 10:24:19 localhost gethtml: connect to host www.56hr.com//main.php [3065531280:utils.h:326]
Feb  7 10:24:20 localhost gethtml: File len: 4101 bytes
Feb  7 10:24:20 localhost gethtml: File len: 3144 bytes
Feb  7 10:24:20 localhost gethtml: File len: 1448 bytes
Feb  7 10:24:20 localhost gethtml: File len: 1807 bytes
Feb  7 10:24:20 localhost gethtml: GET [http://www.cneduhr.com/main.php]...OK
Feb  7 10:24:20 localhost gethtml: File len: 2896 bytes
Feb  7 10:24:20 localhost gethtml: File len: 1448 bytes
Feb  7 10:24:21 localhost gethtml: GET [http://www.bankhr.com/main.php]...OK
...........
...........
...........
关于指针常量,常量指针在编程时遇到的问题:【上一篇】
WebLogic Server 8.1 SSL:【下一篇】
【相关文章】
  • linux下网络配置之ip配置篇
  • linux系统:mkroot: label / not found的解决方法
  • Redhat Linux AS4使用经验记录
  • Linux常用监控和管理命令
  • 虚拟 Linux
  • 谁在禁止Novell发行Linux?
  • 三次握手协议在linux内核中的实现
  • 用机器生成的音乐监控 Linux 计算机
  • 在 Cell BE 处理器上编写高性能的应用程序,第 1 部分: 简介 PLAYSTATION 3 上的 Linux
  • linux下apache,mysq,lphp,Zend Optimizer的配置日志
  • 【随机文章】
  • 阻燃低烟无卤5类4对屏蔽双绞线(305米/箱)
  • 服务器:EMAIL:错误:等候协议超时 30 秒时间已到
  • 本来还想用多线程来做的,后来发现有多进程更容易实现,所以就改成多进程了!
  • 沒事學學網頁設計``````
  • ASP.NET2.0应用中定制安全凭证之实践篇(二)
  • SHX和SMG文件说明
  • 谈谈PHP语法(2)
  • Reflection Using Cg in OpenGL
  • 实现report视图下任何列头的双向排序
  • 【分享】【09-26】注册精品软件下载
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.