代码改变世界

阅读排行榜

(转)使用CGIC实现Web文件上传的服务端代码

2010-09-18 12:31 by shuisheng, 688 阅读, 收藏,
摘要: 转自:http://www.blogjava.net/tmpbuf/archive/2008/11/20/141501.html 用C语言编写cgi程序的话,CGIC是非常流行的库,官方页面及下载地址为:www.boutell.com/cgic/#obtain 不少网站都有文件上传的功能,本文展示如何用CGIC库编写文件上传的服务端程序,最后给出一段简单的HTML代码,供大家测试使用。//upl... 阅读全文

Using epoll() For Asynchronous Network Programming (使用epoll()进行异步网络编程)

2010-09-19 12:53 by shuisheng, 508 阅读, 收藏,
摘要: General way to implement tcp servers is “one thread/process per connection”. But on high loads this approach can be not so efficient and we need to实现tcp服务器通常的方法是“每个线程/进程服务一个连接”... 阅读全文

网络程序测试技巧

2012-11-23 23:24 by shuisheng, 496 阅读, 收藏,
摘要: 最近公司开发一个P2P的网络程序,客户端连上服务端后,调用读socket函数返回0,这个表示对方socket断开。这个程序服务和客户端都是用libevent实现的,服务端是公网IP,是在Linux下运行,客户端是私有IP,运行在Windows。刚开始总以为libevent内部存在问题,因为我们是用bufferevent实现的,也怀疑过是不是公司的路由器有问题。客户端和服务端都有日志,但是从日志里都看不出什么问题,搞了一天半这个问题都没有解决,后来我建议先在局域网内进行代码调试,马上就发现问题了,原来客户端发了个不认识协议,服务器就崩溃了,然后又重启了一个子进程,导致客户端重连,但是服务端有没有 阅读全文

Using C for CGI Programming(3)

2010-09-18 12:18 by shuisheng, 487 阅读, 收藏,
摘要: Mar 01, 2005ByClay DowlinginSoftware--You can speed up complex Web tasks while retaining the simplicity of CGI. With many useful libraries available, the jump from a scripting language to C isn't as ... 阅读全文

high-performance server design

2010-09-19 15:57 by shuisheng, 372 阅读, 收藏,
摘要: from:http://pl.atyp.us/content/tech/servers.htmlIntroductionThe purpose of this document is to share some ideas that I've developed over the years about how to develop a certain kind of application fo... 阅读全文